Related
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, and the rest of the installation goes through just fine. However, when attempting to launch the application from the desktop icon, nothing happens. Looking at the task manager, a new process from the CMD is loaded. This is because it's attempting to run the batch file studio.bat.
When I execute via CMD, I get the following error:
ERROR: cannot start Android Studio. No JDK found. Please validate
either ANDROID_STUDIO_JDK or JDK_HOME or JAVA_HOME points to valid
JDK installation. ECHO is off. Press any key to continue . . .
I've attempted to open the idea properties file to see if there was something I could configure for this ANDROID_STUDIO_JDK or something like that. However, I found nothing. I hope some of you can let me know if you were able to install this or if you are having problems as well.
Adding a system variable JDK_HOME with value c:\Program Files\Java\jdk1.7.0_21\ worked for me. The latest Java release can be downloaded here.
Additionally, make sure the variable JAVA_HOME is also set with the above location.
OK, I figured out how fix this nasty bug.
Before you start
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.
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.
Tip 2
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.
Tip 3
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.
With the last update of Android 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 had the same issue. I got resolved setting up correctly the environment variables in windows, for instance:
JAVA_HOME -> C:\Program Files\Java\jdk1.6.0_45
path -> C:\Program Files\Java\jdk1.6.0_45\bin
I've tried so many of the answers here but none of them works, so I decided to mix some of the answers here and I am successful!
Step 1: Go to the system properties by right-clicking on My Computer or by pressing windows button on typing This PC and right clicking on it and selecting Properties.
Step 2: Click the advanced system settings or Environment Variables
Step 3: Take note that there are 2 different variable. What you need to create is system variables not user variables, when you clicked new type the following
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.8.0_25\ (Note: Please check if the path is right, sometimes it is C:\Program Files (x86)\Java\jdk1.8.0_25)
Step 4: Run the android studio, no need to restart.
Note:
*C:\Program Files\Java\jdk1.8.0_25\ depends entirely on the installation path of your JDK not JRE so don't be confused if you see something like the picture below. Just enter the location of your jdk, in my case it is C:\Program Files\Java\jdk1.8.0_25\.
*Do not include the bin folder when you enter the Variable value.
Edit: For Windows 8 and 10 Users: Try to run C:\Program Files\Android\Android Studio\bin\studio.exe instead of C:\Program Files\Android\Android Studio\binstudio64.exe
I had the same issue. I am having 64-bit windows 8. I downloaded the android studio which worked on a 32-bit machine but not on my 64-bit.
The solution for me was pretty simple. I navigated to
C:\Program Files (x86)\Android\android-studio\bin
there I saw 2 exe files studio.exe and studio64.exe. Normally my start menu was pointing to studio64.exe which always kept on giving me "The environmental variable JDK_HOME does not point to valid JVM". So then I clicked studio.exe and it worked :)
I hope this may help someone facing the same problem as me
The path for the latest JDK. It worked very well.
If you are getting message "Your Android SDK is out of date…" — click "Configure" —> "Project Defaults" —> "Project Structure", pick "SDKs" —> "Android SDK" and in a "Build Target" choose "Android 4.2.2". Click "OK". Now it should work fine.
I got the problem that the installation stopped by the "$(^name) has stopped working" error. I have installed the Java SE Development kit already, and 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 the Java SE Development kit, and set my JAVA_HOME to "C:\Program Files (x86)\Java\jdk1.7.0_21", restart and the installation worked OK.
This problem has been fixed in Android Studio v0.1.1, so just update Android Studio and it should work.
Sometimes you can resolve this type of issue by setting environment variables so the process looks for the JDK in the right spot.
Another approach is to figure out where the process is looking, then put your JDK there.
I've had lots of success using Process Monitor from Sysinternals:
Start -> Run -> procmon
Go to the Filter menu, then select Filter...
Set Event Class is File System then Include
Add, then OK
This will filter down to all the file system operations taking place on your machine.
You could try filtering based on the result of the File System operation:
Right click on the Result column, then Exclude 'SUCCESS'
You can also quite easily filter based on the process name, either from the Filter... menu option or by right clicking on the Process Name column and selecting Include 'process.exe'.
Once you find the file system operation that's failing, the Path column will tell you where to put your JDK.
I've found this to be very empowering. Especially compared to the frustrating process of changing environment variables by trial and error.
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.
Today I found another situation when this problem occures - when you have several JDK, defined in JAVA_PATH. I have:
JAVA_HOME = C:\JAVA\JDK\jdk1.6.0_38;C:\JAVA\JDK\jdk1.7.0_10
So I received this problem with Android Studio setup
But when I've removed one of JDK - problem has been solved:
JAVA_HOME = C:\JAVA\JDK\jdk1.7.0_10
Installation wisard found my jdk and i had a nice night to study studio.
But unfortunatelly even installed studio doesn't work with several jdk.
Does anybody know how to fix it?
I hope I've helped someone
Add JAVA_HOME and JDK_HOME system environment variables.
Right-click
android studio (the 64 version if that's your OS and JDK) and go to
compatibility tab and set "Run as administrator" to true.
Run android studio and high-five me virtually when it works.
If that fails, try "where java" in cmd.exe. If it lists c:\system32\java.exe first, then rename the file and try again.
Windows 64 bit, JDK 64 bit (Solution that worked for me)
Tried all the above solutions, and None of them worked, I have been trying to solve it for the past few days and now I did 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 the old JDK folder and everything was messed up, even uninstalling and reinstalling android studio randomly didn't solve the issue.
Below is the solution that worked for me
Uninstall Android Studio.
clean temp files and android studio C:\Users\Username.AndroidStudio1.5
Uninstall JDK.
Now without JDK try to install Android Studio and now it will show the message that it can't find any JDK. Stop installation
Install JDK 1.7 or 1.8 (Set JAVA_HOME, JDK_HOME, path Environment variables as explained by everybody above)
Install Android Studio.
Done. Enjoy and happy coding.
MAKE SURE YOU RESTART ANDROID STUDIO
Even though I should know better and swear I did, make sure you restart studio after making these changes as it clearly does not check them on every build (which to me makes sense that system/user variables should only be read once on startup)
Anyway, yea... Make sure you restart after you make these changes.
Path = to the bin folder in the jdk folder (path already exists)
JAVA_HOME = to the jdk folder
Install the latest JDK in your system from JDK 7 and JRE 7 Installation Guide.
JAVA_HOME -> C:\Program Files\Java\jdk1.7.0_4
path -> C:\Program Files\Java\jdk1.7.0_4\bin
If setting the JAVA_HOME variable doesn't work for you, set:
STUDIO_JDK=C:\Progra~1\Java\jdk1.8.0_172
Where the path points to your JDK installation
This is the only thing which works for me in Windows 32bit with Android 10 and up.
In my experience, I was unable (even after adding JDK_HOME) to launch Studio via either the shortcut or studio.exe itself. I had to first run bin/studio.bat (mentioned in the original question).
After the first successful launch, I'm able to start it with the shortcut.
If you have a 64 bit windows OS, pointing the JAVA_HOME system variable to
C:\Program Files (x86)\Java\jdk1.7.0_21
Will work when
C:\Program Files\Java\jdk1.7.0_21
fails to work.
You need 1.7 JDK installed on your system. Add a system variable with:
name: ANDROID_STUDIO_JDK
path: your JDK path (for example, C:\Program Files\Java\jdk1.7.0_21)
See more at FIX: Android Studio - Installation Issues on Windows 7 | ERROR: cannot start Android Studio. No JDK found.
TRY TO INSTALL 32BIT JDK
if you have jdk installed and had set up the System Varibles such as JAVA_HOME or JDK_HOME
and tried click back and then next ,you might have installed the 64bit JDK,just download the 32bit jdk and install it.
I downloaded the latest jdk version
JAVA_HOME to C:\Program Files\Java\jdk1.8.0_11\bin
Set the PATH to C:\Program Files\Java\jdk1.8.0_11\bin
I restarted the STUDIO and it worked.
On Windows 10, restarting the installer and running as admin worked for me.
To complete this stack of possible solutions: For me the problem was, that I did not execute the Android-Studio-Setup as administrator. Running it as administrator then made me able to install Android-Studio.
For me, the problem was that I had changed the GC vm arg to -XX:+UseParallelGC in the C:\Users\<username>\.AndroidStudio2.1\studio64.exe.vmoptions file. That's what I use in Eclipse and I was trying various things to get AndroidStudio half way as efficent as Eclipse. I restored the GC to -XX:+UseConcMarkSweepGC.
The answer to the original question is that, might be you are opening android studio from 32 bit shortcut icon of android studio, try to open from icon "studio64" located under .../bin/ where android studio setup is install.
In case you had it running but Now it doesn't Launch.
I deleted the C:\Users\<NAME>\.AndroidStudio<version>\ folder and it worked.
at the beginning it says that failed to find java jdk or jre so i installed it. then i run it again it came up this.
It says that "Failed to find a Main Class in ... eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar"
java file are under
C:\Program Files (x86)\Java\jre1.8.0_31 && jre7
C:\Program Files\Java\jdk1.8.0_31 && jre1.8.0_31
my eclipse file are under
D:\迅雷下载\操作系统\eclipse
can someone tell me how to fix this ??
I was facing the similar issue where on launching eclipse photon it was giving error like:
Failed to find a Main Class in ...
eclipse\\plugins/org.eclipse.equinox.launcher*.jar
One of the reasons in my case was that I had two JDK versions on my system (JDK 6 & JDK 8).
It was running fine but stopped when I updated JAVA_HOME as JDK 6.
To rectify it, I added the below lines in the eclipse.ini file before -vmargs:
-vm
C:/Program Files/Java/jdk1.8.0_111/bin/javaw.exe
-vmargs
Basically, I passed the JDK 8 path to the eclipse as required version for eclipse photon was Java 8. And this got me working.
Try to move eclipse to some simpler path, like D:\development\eclipse
This error is due to because you might have downgraded the version of java in your environmental variables.Try changing the java version in environmental variables and then run the sts or eclipse..for better practice restart the system.hope it helps.!!
I do not mean to steal the first answer - it did help me solve my very similar issue.
I am running Windows 8 x64 bit and installed a modded version of Eclipse in a custom path (rather the default install location that was suggested) - and I got that error.
So, I deleted that Eclipse install. Then installed both x86 and x64 versions of JDK (to their default install locations), and repeated the Eclipse install to the default install location - that solved the problem for me!!!
The reason I installed both JDK versions was because I initially installed only the x64 bit version and a different error came. So I removed that Eclipse again, and repeated the JDK with both versions, etc...
I was on this problem for like an hour and a half not getting that if you save the eclipse file in a non-English named folder it doesn't open.
Hope it helps :)
Check if there are 2 Java paths mentioned in the system Variable "Path"
If yes, Move up the Java path which is mentioned in JAVA_HOME.
For example:
If JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
then the Path should have same Java version's path
Path=C:\Program Files\Java\jdk1.8.0_211
In my case I just changed the Path from
Path=C:\Program Files\Java\jdk1.6.0_45\bin
To
Path=C:\Program Files\Java\jdk1.8.0_211
Remove Eclipse from Non English folder if any.
This is issue might be because of the folder location or the JDK version,
I installed the latest version JDK and with eclipse-inst-win64 provided by eclipse i was able to install and run successfully
Same thing happens when you change eclipse.exe to a different name, seems like org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar starts the ide and looks for eclipse.exe
In my case, the Eclipse installer downloaded the wrong VM vertion. I download it separately. Choose it in clause "Java 11+ VM" and it works. Also check you do not have Russian letters in eclipse.ini. If you do, then change the encoding to UTF-8 and write the right letters in Russian.
I installed Android Studio but it was giving me error that I need to install JDK but JDK was already installed. Then I realized it is asking to install 64bit version of JDK.
Anyway I just downloaded latest JDK 64bit version and set the following in Environment Variable but still Android Studio is giving error:
Error
'tools.jar' seems to be not in Android Studio classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.
Following paths are set in my Windows 8.
Path in User Variables
E:\Program Files\Java\jdk1.8.0_25\bin
JAVA_HOME in System Variables
E:\Program Files\Java\jdk1.8.0_25
Path in System Variables
E:\Program Files\Java\jdk1.8.0_25\bin
32bit JDK is installed on C drive while 64bit JDK is installed on E drive (as shown above). 32 bit JDK is not being used in any User or System Variables.
I have also restarted the PC.
How do I fix this issue?
I had this same problem and was able to fix it after wasting about 3 hours:
Just copy tools.jar from %JAVA_HOME%\lib to (Android Studio Root)\lib
check your JAVA_HOME value!
it should be like this
E:\Program Files\Java\jdk1.8.0_25\jre
First locate in your PC the route of your JDK (for instance: C:\Program Files\Java\jdk1.7.0_45)
then change the JAVA_HOME variable as follows:
Right-click the My Computer icon on your desktop and select Properties
Click the Advanced tab
Click the Environment Variables button
Under System Variables, click New
Enter the variable name as JAVA_HOME
Enter the variable value as the installation path for the Java Development Kit
I installed jdk 1.8.0_51 64bit on Windows7.
After that, no JAVA_HOME was defined, so I had to define it myself as described above, but it did not work unless I added a trailing backslash:
D:\Programs\Java\jdk1.8.0_51\.
Without the backslash at the end it did not work.
Known issue - my solution was to install JDK 7u80 - worked after that.
https://code.google.com/p/android/issues/detail?id=187048
Just Copy the tools.jar from your jdk to Android lib directory.
In my case I've installed newest Java version without uninstalling older version first. After I've uninstalled the older Java version this error was gone.
Also make sure your JAVA_HOME system variable is set properly, e.g.:
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.8.0_31\
And finally, that you've installed proper version for your OS, x86 or x64.
I had exactly the same problem.
In my case I finally installed JRE to "C:\Program Files..." and the JDK to my default destination , which is "E:\Program Files..."
It seems that the JDK and JRE cannot point to the same place for Android Studio .
I had the same issue on windows 7 when I installed Android Studio. I had Jdk 8 on my system. So for me, copying the tools.jar from jdk\lib to androidstudio\lib worked. I found the tools.jar was missing from androidstudio's lib directory. I had set JAVA_HOME in user variable and JDK in system variable.
I had the same error -- tools.jar seems to be not in Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.
I have a few Java JDKs downloaded. JAVA_HOME was pointing to C:\java\jdk1.7.0_45. When I switched to C:\java\jdk1.7.0_75, it worked. It makes no sense - both have lib/tools.jar. I did a jar tvf on each of the tools.jar files and they were fine. I ran java -version on each java & it ran ok. Dunno - makes no sense.
Platform: Windows 7 Professional - 64-bit v1.10.00.AG B11 Service Pack 1
Installing it to the default installation path instead of a custom one did solve the issue for me.
Source: https://code.google.com/p/android/issues/detail?id=187048#c9
First locate in your PC the route of your JDK (for instance: First locate in your PC the route of your JDK (for instance: C:\Program Files\Java\jdk1.8.0_11)
then change the JAVA_HOME variable as follows:
Right-click the My Computer icon on your desktop and select Properties
Click the Advanced tab
Click the Environment Variables button
Under System Variables, click New or edit it if there already a path for it ( you should make sure that the path is jdk)
Enter the variable name as JAVA_HOME
Enter the variable value as the installation path for the Java Development Kit)
1) Just install JDK from here
2) Change JAVA_HOME variable (e.g. C:\Program Files\Java\jdk1.8.0_112)
I add a similar problem on Linux.
In my case my JAVA_HOME env was pointing to the JRE HOME instead of the JDK HOME.
On my linux system I had done:
sabayon ~ # eselect java-vm list
Available Java Virtual Machines:
[1] icedtea-bin-8
[2] oracle-jdk-bin-1.8
[3] oracle-jre-bin-1.8 system-vm
sabayon ~ # eselect java-vm set system 2
And then Android Studio started like a charm. Download and install the SDK.
After I set JAVA_HOME variable and restart my windows pc I resolved my issue.
JAVA_HOME value should like below.
C:\Program Files\Java\jdk1.8.0_25\bin
I paste a screenshot for someone's help.
You can go here From My Computer / This PC > Property > Advance Variable.
I recently came across this issue while using a Managed Software solution. The company I was working with had Android Studio has part of their managed applications, however, it was a much older version that the latest release. When you use an older version of Android Studio coupled with a newer JDK (I tried 11 and 15) you then receive the error indicating tools.jar cannot be found in CLASSPATH. I resolved this by downloading the latest version from Android Studio's website and it worked like a charm!
I tried everything I could but it didn't help. So I reinstalled Windows and installed Android Studio and now everything works.
And the irony is, there is no JAVA_HOME or JDK_HOME variable defined but it still works.
When I clicked SDK Manager on Program Files or run it in cmd, nothing happened. I did:
Installed latest JDK
Installed latest Android SDK
Set environment JAVA_HOME and put %JAVA_HOME%\bin in path variable**
Actually a black cmd window appears and disappears a milliseconds.
How to fix it?
Edit:
I Googled day by day but can't find a solution for this. Even I set path for ANDROID_SWT it also can't run. I suspect that Android SDK has bug in its installation package.
Android installation - sdk manager.exe does not work
Android installation/SDK Manager issues
I'm totally exhausted and this is the last my try:
Uninstall JDK, Android SDK, remove all ANDROID or JAVA environment variables
reinstall JDK and Android SDK
But nothing changes.
Edit:
Actually this is the second time I meet this problem. I got this problem only after I added more Environment variables for Ant and Maven. This is the summary:
Install Windows XP SP3 --> Install JDK --> Install Android SDK --> Open SDK Manager and it works! --> append some more "bin" path of Ant and Maven in "path" variable --> Open SDK Manager and it doesn't open --> I rolled back by removing all environment variables --> SDK Manager still no opens! That's very strange! --> It is stranger when I reinstall JDK and Android SDK, it still no opens! :(
Step #1: Open up a command prompt.
Step #2: Use the cd command to move to wherever you installed your Android SDK.
Step #3: Run tools\android.
If that does not work, you should have information dumped to the command prompt that will help you diagnose your setup problem.
I was getting the error "C:\Program is not recognized as an internal or external command"
Followed by loads of "unable to copy file"
Followed by something about Android_SWT not being able to be found.
The way I fixed the problem on my system (Windows 8, 64 bit, JDK 7) was:
Create JAVA_HOME environment variable and point it to C:\Program Files\Java\jdk1.7.0_10\bin
Open ANDROID SDK DIRECTORY\tools\android.bat in your favorite text editor
Find the lines set java_exe= call lib\find_java.bat (it's split over 2 lines)
Replace the lines with set java_exe="%JAVA_HOME%\java.exe"
Save and run tools\android.bat
The problem was that the the space in the path was not being handled correctly. By wrapping the path in quotation marks, the space is then correctly catered for.
I had the same problem.
when i run \tools\android.bat, i got the exception:
Exception in thread main
java.lang.NoClassDefFoundError: com/android/sdkmanager/Main
My resolved method:
edit \tools\android.bat
find "%jar_path%;%swt_path%\swt.jar"
modify to "%tools_dir%\%jar_path%;%tools_dir%\%swt_path%\swt.jar"
save, and run SDK Manager.exe again
After a lot of searching and trying different methods, I found the solution to the problem at my end: SDK Manager couldn't find my profile directory. After setting the environment variable ANDROID_SDK_HOME (I set mine to a newly created folder C:\Android), SDK manager started no prob.
I have Wondows 7 64 bit (MacBook Pro), installed both Java JDK x86 and x64 with JAVA_HOME pointing at x32 during installation of Android SDK, later after installation JAVA_HOME pointing at x64.
My problem was that Android SDK manager didn't launch, cmd window just flashes for a second and that's it. Like many others looked around and tried many suggestions with no juice!
My solution was in adding bin the JAVA_HOME path:
C:\Program Files\Java\jdk1.7.0_09\bin
instead of what I entered for the start:
C:\Program Files\Java\jdk1.7.0_09
Hope this helps others.... good luck!
My issue was the following error on windows 7:
C:\dev\Android\android-sdk-windows\tools>android
[INFO] Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3550 or
swt-win32 in swt.library.path, java.library.path or the jar file
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at com.android.sdkmanager.Main.showMainWindow(Main.java:292)
at com.android.sdkmanager.Main.doAction(Main.java:276)
at com.android.sdkmanager.Main.run(Main.java:99)
at com.android.sdkmanager.Main.main(Main.java:88)
The solution was to disable McAfee 8.8. Apparently some recent update is now blocking my Android environment.
The way I solved your last problem was by right clicking the android.bat file, and chose edit with notepad++. I then went down to the part of the program where it had this bit of code:
cd /d %~dp0
It was also some other lines of code, but I deleted them. After deleting these other lines I simply just wrote(under the cd /d %~dp0):
cd Program Files
cd java
cd jdk1.7.0_03
cd bin
I dont know here you java.exe file is located but mine was at lest located there.
I ran into this problem: I'd get the error
C:\projects\Android\android-sdk-windows-1.5_r1\tools\lib>ddms
02:03:07 E/ddms: shutting down due to uncaught exception
02:03:07 E/ddms: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the jar file
java.lang.UnsatisfiedLinkError: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the j
ar file
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.graphics.FontData.<init>(Unknown Source)
at com.android.ddms.PrefsDialog.setDefaults(PrefsDialog.java:221)
at com.android.ddms.PrefsDialog.init(PrefsDialog.java:150)
at com.android.ddms.Main.main(Main.java:74)
I got this solved by copying the swt file from eclipse into the tools directory. If you search in the directory you have Eclipse installed there is an SWT dll, named something like swt-win32-<4-digits>.dll (mine was named swt-win32-3740.dll): I copied that into the tools directory, and everything worked after that.
I solved my problem opening android.bat inside sdk/tools and setting the java_exe property, which was empty.
set java_exe="C:\Program Files\Java\jre6\bin\java"
Similar to sixty9 I renamed java.exe, javaw.exe, javaws.exe (I never delete files when troubleshooting) after I created a JAVA_HOME environment variable and added path variables.
I had installed the Java SDK on my D:\ drive ( instead of the default).
Create a JAVA_HOME variable: Variable Name: %JAVA_HOME% Value: D:\Program Files\Java.
Added the following to the Path variable:
%JAVA_HOME%\jre7\bin;%JAVA_HOME%\jdk1.7.0_03\bin;
Renamed java.exe, javaw.exe and javaws.exe.
Restarted the system and the Android SDK installer found my JDK and installed successfully.
I add new environment variable "ANDROID_SDK_HOME" and set it, like my path to android SDK folder (c:/Android) and it's work!
And if tools\android works for you while .exe doesn't, it's probably the x64 java.
It started working when i completely uninstalled JDK with JRE (shows as separate option in windows uninstal control panel applet) and android sdk and reinstalled using x86 version.
Why does it worth the time, you may ask? Well, such an inconsistency obvoiusly means that amount of testing with x64 java is zero and so you can probably experience many other failures in the future.
Finally got this torterous SDK to run.
When installing 32bit Java on 64bit windows system, set ANDROID_SWT to e:\android-sdk\tools\lib\x86
not ..\x86_64
Dear Android SDK team,
I genuinely hope some serious attention is being paid to these problems. SDK should be effortless to set up. This is how you lose customers to other platforms where this kind of thing is a one-click ordeal.
I was going to buy another android device to test my game on, but after last 2 days trying to traverse the maze of your incompetence I think i'll just stick with iOS as my main development target.
I solved this problem, which occured for me after manually installing the ADT (4.2/api 17) bundle on Windows 7 64 bit in C:\Program Files.
The steps I had to take:
Set the JAVA_HOME environment variable to the installation directory of the (64 bit) JDK, C:\Program Files\Java\jdk1.7.0_11 in my case.
Run SDK Manager as administrator at least once. SDK Manager allows you to change files in Program Files, so you should give it the proper access rights.
None of the Solution worked for me
Just open sdk/tools/
Edit android.bat
Replace set java_exe="C:\Program Files\Java\jdk1.7.0_13\bin\java.exe" //your java path
Copy the sdk manager and avd from any tools/lib if its not in sdk/ base folder
I FINALLY GOT THIS WORKING AFTER 2 SOUL DESTROYING EVENINGS OF TRYING! IF I EVER MEET AN ANDROID SDK DEVELOPER I WILL HACK HIM TO DEATH WITH HIS OWN KEYBOARD
Anyway, tips for getting it working on Windows 7 64 bit...
I suspect for me it was multiple problems as none of the suggestions worked so I will list all the things I did to finally get it working
1) Install the 32 BIT version of Java JDK (yes, even if you are running 64bit Windows)
2) Install both the SDK and the JDK to paths that have no spaces in (I used C:\Android and C:\Java32)
3) In the Windows environment variables screen (System Properties > Advanced Settings > Env vars), there's two places you can enter the variables, the "User Variables" and "System variables". I put them in both and included the "bin" bit in both e.g.
JAVA_HOME = C:\Java32\jdk1.8.0_20\bin
Path = C:\Java32\jdk1.8.0_20\bin;other paths should come AFTER the jdk...
4) Edit the file tools\android.bat and look for the following:
set java_exe=
call lib\find_java.bat
change this to:
set java_exe="C:\Java32\jdk1.8.0_20\bin\java.exe"
rem call lib\find_java.bat
You can also put the "#echo off" to "#echo on" at the top of the file for debugging purposes
Good luck!
I had this same problem and after trying a variety of things like changing the path variables I went to java.com on a whim and downloaded java, installed, and lo and behold the sdk manager worked after that.
Had the same problem and tried everything I browse in several forums till I found a clue, then finally solved the problem.
Basically I installed the SDK and worked ok, then my Windows Vista crashed, on restart I run SDK again but it only opened a CMD window which closed immediately.
So here's a list of useless things I did:
Went to CMD "d:/java/android/tool" and execute "android.bat", didn't work and show an pointer exception error.
Reinstalled the whole thing JDK + SDK
Changed the system path to a new folder
I traced and deleted all android occurrences on Regedit
At this point I was seriously considering start learning objetive-c was not a bad idea, finally I did this:
delete ".android" folder from "c:/users/youruser/"
delete all files within "c:/users/youruser/AppData/Local/Temp"
reinstall SDK
it WORKED !! I'm not sure though if is necessary to uninstall SDK (since I had again to download all packages & platforms) and just clear the temp folder.
Hope this helps.
I fixed this issue by reinstalling it in Program Files, it originally tried to install it in c:/Users/.../AppData/Android/....
Mine was caused by a user permission issue that running as admin didn't seem to fix (perhaps because they call batch files?).
I had the same problem, running X64 Java (1.7.0_03-b05). Even though I had both C:\Program Files\Java\jre7\bin and C:\Program Files\Java\jdk1.7.0_03\bin listed in my path, it wouldn't start - just flashed a command prompt.
The tools\lib\find_java.bat file was reporting that it was attempting to run C:\Windows\system32\java.exe but failed. Huh? I checked, and found outdated copies of java.exe, javaw.exe and javaws.exe in my C:\Windows\system32. How did those get there, I didn't put them there!
I deleted those three files from C:\Windows\system32 and the problem was fixed.
Thinking about it, the problem likely would have been fixed by making sure thatC:\Program Files\Java\jre7\bin and C:\Program Files\Java\jdk1.7.0_03\bin were at the START of my PATH variable instead of tacked onto the end.
I was experiencing the UnsatisfiedLinkError on Windows 7 64-bit after installing adt-bundle-windows-x86_64-20130717.zip:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the jar file
The root cause was that McAfee has a feature that blocks loading DLL's from the temporary directory. This is a problem because android.bat copies a bunch of JAR and DLL files to a temporary directory and runs the program from there, to make it easy to upgrade the app in-place.
This feature can be disabled, however. You can either disable "Access Protection" altogether or only disable the feature that blocks loading DLLs from temporary folders.
I had the same issue!
I had installed the ADT bundle 64-bit, so I downloaded Java 64-bit. I messed around with paths and things, but the thing that fixed it in the end was installing Java 32-bit.
The easy fix is to install both versions. You can download them manually here.
Good luck!
When I clicked SDK Manager on Program Files or run it in cmd, nothing happened
One of your problems is Long File Names in Windows. A number of the Android tools cannot handle them. I filed a bug report on them years ago, but I can't find it at the moment. I also seem to recall something about it in the INSTALL or README.
So you should install the tools in a location without spaces. Use something like C:\Android\ or C:\Android-SDK\.
#Steve and #MeatPopsicle already mentioned spaces in the pathames, but it can't be overstated.
Actually a black cmd window appears and disappears a milliseconds.
...
Even I set path for ANDROID_SWT
Out of curiosity, where did ANDROID_SWT come from?
I know Android does use ANDROID_HOME, ANDROID_SDK_ROOT and ANDROID_NDK_ROOT, and the last two should both be set because the tools use them internally. Here's the reference on ANDROID_SDK_ROOT and ANDROID_NDK_ROOT: Recommended NDK Directory?.
So you should set the three environmental variables (after ensuring the installation directory does not contain spaces):
ANDROID_HOME
ANDROID_SDK_ROOT
ANDROID_NDK_ROOT
ANDROID_HOME is set to the directory where the hidden directory .android is.
ANDROID_SDK_ROOT is set to the directory where the SDK is installed, like C:\Android-SDK\.
ANDROID_NDK_ROOT is set to the directory where the NDK is installed, like C:\Android-NDK\. If its not installed, then don't set it.
Once you have ANDROID_SDK_ROOT set, you can put %ANDROID_SDK_ROOT%\tools and %ANDROID_SDK_ROOT%\platform-tools on PATH. Then, you can drop into a command line and issue something like this (and it just works):
adb list
What I did was:
set a new environment variable in the top user section.
VARIABLE NAME: JAVA_HOME
VARIABLE VALUE: set it to the installation directory of your most recent JDK.
For me it was, C:\Program Files\Java\jdk1.7.0_13 . Run SDK Manager as administrator at least once. I use windows 7. This method worked for me after a lot of research.
What I dont understand is when using 'where java' in the command prompt it still references C:\Windows\System32\java.exe. My SDK Manager now opens when I need it so I solved my problem.
find_java.exe doesn't seem to like the openjdk "java -version" output. I edited find_java.bat like this:
for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
set java_exe="C:\Program Files (x86)\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin\java.exe"
rem ...
for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a
set javaw_exe="C:\Program Files (x86)\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin\javaw.exe"
I'm trying to install the Android SDK on my Windows 7 x64 System.
jdk-6u23-windows-x64.exe is installed, but the Android SDK setup refuses to proceed because it doesn't find the JDK installation.
Is this a known issue? And is there a solution?
Press Back when you get the notification and then Next. This time it will find the JDK.
Actual SETUP:
OS: Windows 8.1
JDK file: jdk-8u11-windows-x64.exe
ADT file: installer_r23.0.2-windows.exe
Install the x64 JDK, and try the back-next option first, and then try setting JAVA_HOME like the error message says, but if that doesn't work for you either, then try this:
Do as it says, set JAVA_HOME in your environment variables, but in the path use forward slashes instead of backslashes.
Seriously.
For me it failed when JAVA_HOME was C:\Program Files\Java\jdk1.6.0_31 but worked fine when it was C:/Program Files/Java/jdk1.6.0_31 - drove me nuts!
If this is not enough, also add to the beginning of the Environment Variable Path %JAVA_HOME%;
Updated values in System Environment Variables:
JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
JRE_HOME=C:/Program Files/Java/jre8
Path=%JAVA_HOME%;C:...
I found the solution and it's beautifully stupid. I found Android SDK cannot detect JDK.
Press the Back button on the SDK error screen that tells you that the EXE couldn't detect the JDK. Then press Next.
Who would have thought that would happen?
It seems like it doesn't work without 32 bit JDK.
Just install it and be happy...
I downloaded the .zip archive instead and ran SDK Manager.exe, and it worked like a charm. You had the same issue with the .exe otherwise.
Warning: As a commenter mentioned, don't try this on a Windows 7! I tested it with Windows XP 64 bit.
As the posted solution does NOT work for all (including me, myself, and I), I want to leave a note for those seeking for another way (without registry hacking, etc.) to solve this on a Windows 64 bit system. Just add PATH (capital letters!!) to your environment Variables and set the value to your JDK-Path.
I added JDK to the existing "Path" which did not work, like it didn't with JAVA_HOME or the "Back"-Solution. Adding it to "PATH" finally did the trick.
I hope this might be helpful for somebody.
All you need are the following two registry entries. It appears as if whoever posted the other registry stuff basically just copied all the keys from HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft into HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft,
which obviously isn't an ideal solution because most of the keys aren't needed.
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit]
"CurrentVersion"="1.6"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit\1.6]
"JavaHome"="C:\\Program Files\\Java\\jdk1.6.0_23"
Non of these solutions worked for me. I fixed it by temporarily changing the filename of C:\Windows\System32\java.exe to java_.exe
None of the solutions here worked for the 64-bit version.
Putting the JDK path before the c:\windows\system32\ path in your environment variables solves the problem. Otherwise the 32-bit java.exe is found before the 64-bit JDK version.
After reading a couple of blog posts, it does seem to be even an easier fix by clicking BACK when the installer says couldn't find the JDK, and then simply click NEXT again and magically it finds the JDK. No registry messing around or re-downloading etc..
Adding JAVA_HOME environment variable (under System Variables) did the trick for me.
Clicking "Back" and "Next" buttons didn't work.
Windows 7 Professional x64, JDK 1.7.0_04 (64 bit, I don't have x86 version installed)
I think that installer tries to find JDK in specific (1.6?) version and if it can't find it, checks JAVA_HOME which was not set in my case. I have another computer (the same system but with JDK 1.6 x64) and it worked without JAVA_HOME variable.
You don't have to install 32 bit version of JDK :)
I copied the Java.exe from
C:\Windows\System32
to
C:\Windows\SysWOW64
and it worked.
I'm using 64 bit Windows 8.
Setting the JAVA_HOME environment variable to
C:\Program Files\Java\jdk1.7.0_07
instead of
C:\Program Files\Java\jdk1.7.0_07\bin
fixed it for me.
The guy above who put this: "I experienced this problem too, but none of the answers helped. What I did, I removed the last backslash from the JAVA_HOME variable and it started working. Also, remember not to include the bin folder in the path." This was in fact the correct answer.
For this SDK to install this is what I did. I am running the latest Microsoft OS Windows 8.
User Variables:
Path C:\Program Files\Java\jdk1.7.0_07\bin
Environment Variables
Create these two:
CLASSPATH %HOME_JAVA%\jre\lib
HOME_JAVA C:\Program Files\Java\jdk1.7.0_09
This one already exists so just edit:
Path At this end of WindowsPowerShell\v1.0\ simply add ";C:\Program
Files\Java\jdk1.7.0_09"
This is what I did and it worked for me. =)
This registry fix worked like a charm on my Windows 7 x64 setup: http://codearetoy.wordpress.com/2010/12/23/jdk-not-found-on-installing-android-sdk/
Press Report error and OK. Next will be enabled.
Try downloading and installing the zipped version rather than the .exe installer.
Also, RUN AS ADMINISTRATOR! Worked for me with backslash fix.
I had the same problem, tried all the solutions but nothing worked. The problem is with Windows 7 installed is 64 bit and all the software that you are installing should be 32 bit. Android SDK itself is 32 bit and it identifies only 32 bit JDK. So install following software.
JDK (32 bit)
Android SDK (while installing SDK, make sure install it in directory other than "C:\Program Files (x86)", more probably in other drive or in the directory where Eclipse is extracted)
Eclipse (32 bit) and finally ADT.
I tried it and all works fine.
I had the same problem and solved it by installing the x86 version of the JDK (on Windows XP x64).
I experienced this problem too, but none of the answers helped. What I did, I removed the last backslash from the JAVA_HOME variable and it started working. Also, remember not to include the bin folder in the path.
Android SDK is 32 bit app, and it requires the 32 bit of JDK to work... the 64 bit JDK won't make any use for it...
1-Simply done the "JAVA_HOME" environment variable thing.
2-Right-Click on Android SDK and from compatibletiy Tab Select windows 7 and administrator.
3-Run it again.
WORKING SOLUTION AND NO REGISTRY MODIFY NEEDED
Simply put your java bin path in front of your PATH environment.
PATH before
C:\Windows\system32;C:\Windows\%^^&^&^............(old path setting)
PATH after
C:\Program Files\Java\jdk1.6.0_18\bin;C:\Windows\system32;C:\Windows\%^^&^&^............(old path setting)
And now the Android SDK installer is working.
BTW, I'm running Win7 x64.
For installer_r21.1-windows.exe on Windows 8 x 64 what worked for me was setting up my user environment variable JAVA_HOME to C:\Program Files\Java\jdk1.7.0_10.
Hope this helps you all! :)
Yeah install the 32 bit version of the Java SE SDK (or any of the combinations). That should help solve your problem.
I'm running a 64-bit version of Windows 7 and I was getting this issue when attempting to install Android Studio 1.0 using the executable from:
http://developer.android.com/tools/studio/index.html
I tried all the listed solutions and several different versions of JDK 1.7 and 1.8 -- no dice. I went with installing the zipped version of the application and it worked like a charm:
http://tools.android.com/download/studio/canary/latest
Still baffled by this problem; especially since beta versions of Android Studio worked just fine.
The above methods did not work for me in Windows 8 Pro.
Just set the path to
C:\Program Files\Java\jdk1.7.0_07\
Where C is your drive in which you have installed the JDK.
Don't forget the backward slash at the end.
You will have to download the 32-bit SDK version because Win7 64-bit is not supported only Windows Server 2003 has a supported 64-bit version. During the download of Java SDK pick "Windows" as your platform and not "Windowsx64".
Once I did this android SDK installed like a charm. Hope this helps.
I tried several posted solutions and then it took a system reboot before it started working, which may have been because I had just installed the JDK. Here are all the things I had going on - not sure which ones were essential:
64-bit JDK installed.
JAVA_HOME defined using forward slashes (/) instead of backslashes
().
JDK 'bin' directory listed at beginning of PATH.
System reboot.