I downloaded Android Studio and attempted to launch the program.
This is running on Windows 7 64-bit with Java 1.7. During the installation my Java 1.7 is detected,
With the last update of Androd Studio I have two versions of the IDE's launcher
One is called studio.exe and the other studio64.exe they are both on:
C:\Users\myUserName\AppData\Local\Android\android-studio\bin
You have to launch the one that matches your Java version 64 or 32 bit
I got the problem that the installation stopped by "$(^name) has stopped working" error. I have installed Java SE Development kit already, also set both SDK_HOME and JAVA_HOME that point to "C:\Program Files\Java\jdk1.7.0_21\"
My laptop installed with Windows 7 64 bits
So I tried to install the 32 bit version of Java SE Developement kit, set my JAVA_HOME to "C:\Program Files (x86)\Java\jdk1.7.0_21", restart and the installation worked OK.
OK, I figured out how fix this nasty bug.
Go to your Android Studio installation folder and locate the bin folder. Inside the bin folder, you will find studio.bat. Execute the file, and it'll show the error. If it is about the Java path then follow the tip 1.
When you set the path JAVA_HOME
, etc., make sure not to include bin
at the end of the path. This solved the issue for me.
JAVA_HOME
=> C:\Program Files\Java\jdk1.7.0_21
path
=> C:\Program Files\Java\jdk1.7.0_21\bin
It works fine with JDK 1.7 (I tried with 32 bit).
If you do so, you can see the initial screen as below.
Are you getting the below error message?
Your Android SDK is out of date or is missing templates. Please ensure you are using SDK version 22 or later.
This error probably occurs, because you have reference to your older SDK (that you downloaded with Eclipse) in your path variable. Go to Environment variables and remove any reference to the old SDK folder and point it to new SDK folder that is found inside the Android Studio installation folder.
Save and restart Studio, things should work as expected now.
If you hate messing around with the path variable as given above by removing old references, simply follow the following steps to refer to new SDK path that comes with Studio.
*Project Defaults* -> *Project Structure* -> Click "New" -> Select "Android SDK" -> Select the SDK
folder inside the studio installation.
My issue was caused because I have an &
character in my Windows user name, so when installed in the default path I was getting the following error after running bin/studio.bat
|
v notice broken path
The system cannot find the file C:\Users\Daniel \studio64.exe.vmoptions.
Exception in thread "main" java.lang.NoClassDefFoundError: com/intellij/idea/Main
Caused by: java.lang.ClassNotFoundException: com.intellij.idea.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.intellij.idea.Main. Program will exit.
So I uninstalled and reinstalled it to program files and it launches fine now.
I couldn't get this to work no matter which environment variables I set. So I simply put a copy of the JDK into my Android Studio installation folder.
Copy the contents of the JDK installation (for example, C:\Program Files (x86)\Java\jdk1.7.0_21
)
Paste them into the installation directory of the Android Studio (for example, C:\Program Files (x86)\Android\android-studio
)
I somewhat assumed that the issue was caused by having the x64 version of the JDK installed. But what was especially confusing was the fact that I could start Android Studio just fine when I started the studio.bat
as an Administrator (even though the environment variables were set for my personal user account).
studio.bat
will look for several valid options when determining which JDK to use.
:: Locate a JDK installation directory which will be used to run the IDE.
:: Try (in order): ANDROID_STUDIO_JDK, ..\jre, JDK_HOME, JAVA_HOME.
As explained above, I picked the ..\jre
option.
Windows 64 bit, JDK 64 bit (Solution that worked for me) Tried all the above solutions, None of them worked, I have been trying to solve it from past few days and now i done it successfully.For me the problem was, when i first installed Android Studio my JDK version was 1.7, then after installing i updated the JDK to 1.8,then i removed old JDK folder and everything was messed up, even uninstalling and reinstalling android studio randomly didn't solved the issue.
Below is the solution that worked for me
1) Uninstall Android Studio.
2) clean temp files and android studio C:\Users\Username.AndroidStudio1.5
3) Uninstall JDK.
4) Now without JDK try to install Android Studio and now it will show message that it cant find any JDK. Stop installation
5) Install JDK 1.7 or 1.8 (Set JAVA_HOME,JDK_HOME,path Environment variables as explained by everybody above)
6) Install Android Studio.
7) Done. Enjoy and happy coding.