Android SDK installation doesn't find JDK
Asked Answered
I

45

1243

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?

SDK Error

Illhumored answered 7/12, 2010 at 22:12 Comment(10)
What do you mean by "the Android-SDK-Setup refuses to proceed"? AFAIK, installing android-sdk_r07-windows.zip is simply unzipping it to a folder (e.g. C:\android-sdk-windows) and appending that folder to the %PATH% environment variable. Please clarify, so that we can help you better.Monika
I'm having the same problem with installer_r08-windows.exe (which is the "recommended" download). Setting JAVA_HOME doesn't seem to help. I suppose I'll try the zip file next...Shani
@AndroidEve: The Android SDK (maybe not the ADT) for Windows is an EXE file, for example installer_r22.0.1-windows.exeMaledict
I marked Lazarus- comment as useful, but it isn't! That solution won't work on Windows 8!Frizzy
the solution from Jules Colle + setting JAVA_HOME environment is working on my Windows 7 64 bit.Heart
Simplest way, open tools/android.bat file, find the line says "set java_exe", change it to "set java_exe=ABSOLUTE_PATH_TO_YOUR_JAVA_EXE" and comment out the two following lines;Mesothorax
@Jurgen's answer is wrong. Silly Back-Next just doesn't workChaves
Related: Android SDK doesn't find JDKKraemer
Its' such a shame that an official compiler contain such basic bugs.Silhouette
This solution works perfectly for me: Click HereGrizzle
T
1257

Press Back when you get the notification and then Next. This time it will find the JDK.

Taraxacum answered 7/12, 2010 at 22:12 Comment(18)
Wah I re-downloaded JDK installer on my slow line only to realise that I DO HAVE JDK installed! And this worked thanks!Anoxia
This is a pretty weird bug to say the least. It popped up on a workstation but not my desktop.Beauregard
It looks like cache the test result, and even so after restar the computer you must start setup, forward till this step, press back, and press next again. For windows 7 x64, there is a registry fix: searching for Windows 7 x64 Registry Android, is possible to find it.Anders
Doesn't work for me on Windows 7 x64. I'm not joking. I set JAVA_HOME and I tried clicking back and next several times, but it's still not working. Neither does running SDK Manager.exe from the archive and I am positive I have JDK 7 installed (even ran the installer again and it told me it's already installed).Politburo
@f.ardelian, take a look at my answer (just posted it). it worked for me, it might for youSwanskin
Not a working fix for Windows 7 x64, suggest an edit to the answer to make that clear.Autumn
Sadly the fix isn't working on 7 x64 JDK 7 and last Android SDKPathy
I've tried setting JAVA_HOME to [...]system32/java.exe, C:\Program Files\Java\jdk1.7.0_09\bin\java.exe and just C:\Program Files\Java\jdk1.7.0_09 but the installer still doesn't recognise it. I have tried going back nad forth as descirbed several times. Also useing Win7 64bitTalmudist
I don't know if Windows 8 is the relevant factor, but it certainly doesn't work on my Windows 8 machine.Chlordane
Setting JAVA_HOME to C:\Program Files\Java\jdk1.7.0_17 worked for me (of course you need to restart the installer for changes in environment variables to take effect; back and forth won't work for that).Chlordane
After I installed JDK6 and set JAVA_HOME to C:\Progra~1\Java\jdk1.6.0_45, then the installer picked up JDK7. Android SDK docs do say that JDK 6 is required - developer.android.com/sdk/index.html. This was on Win 7 Pro 64bit.Timbered
after setting JAVA_HOME, end install program and try rerun several times, it works!Sharla
does not work for me, even installed java fresh - but of course not to C drive which is prob why the POS doesnt get found.Roundup
It is not a valid solution anymore, gotta find out something new :/Musaceous
This just worked for me on Win 7 x64. Had to enter a VALID path, hit Next, get the error, go back, go Next again, leave the path completely blank, then Next again. Works for me.Oe
For windows 7 x86. If you installed the java jdk while the android studio is open, try closing the android studio installer and try again. It immediately detected the jdk so seems to be fine with me.Neat
I had the same problem but my JAVA_HOME was pointing to C:\Program Files\Java\jdk1.7.0_79\bin; I changed it to C:\Program Files\Java\jdk1.7.0_79 and now it works - Running W7 - X64Lifeboat
Didn't work for me. So, I closed and reopened the setup. Then it worked.Gennygeno
O
284

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:...
Overthrust answered 7/12, 2010 at 22:12 Comment(18)
YES!!! this one worked for my win 7 pro 64 bit install with android r18 exe installer. You, sir, are my hero for today. Now I just need to know how on earth you thought to even try that? :-)Urson
I guessed that the likely Windows haters that coded this never bothered to actually test it, and their Unix forwardslashes weren't converted to Windows backslashes.Overthrust
Almost gave up because NOTHING was working, including this solution. My problem however was I was trying to be too smart! I had JAVA_HOME set to C:/Program Files/Java/jdk1.7.0_03/BIN but you DON'T need to include the /bin!!! Just remove it and you'll be good!Yeah
Remembering to restart the installer after adding the ENV Variable.Thrive
Another tip: I've gotten into the habit of ending with ';', in case I want to add another address later - don't do that here.Barny
all right my fault is appending a semicolon to JAVA_HOME. remove it. win7 x86_64.Sicken
Strangely, when I set the JAVA_HOME from forward-slashes Java 6 JDK, it finally found my Java 7 JDK... :)Carisa
Thanks for pointing the problem with the slashes out! I had exactly the same problem!Suffix
Amazing!!! They seriously should do something about this dumb forward slash problem!Papaya
Setting the JAVA_HOME worked for me under Win8 (C:\Program Files\Java\jdk1.7.0_10). Dont forget to reboot after setting the JAVA_HOMEServiette
back-next wasn't needed in my case, forward slashes fixed the issues (win 7 x64 ultimate)Craftwork
this one worked for me on Windows 8.1 RTM, most voted answer (press back and next again) didnt workSandbank
Worked for me on Windows 8.1, on next step I got full path to java like this C:/Program Files/Java/jdk1.7.0_51\bin\java.exe!Lenette
Mine worked with backward slashes(\) but I had to put a backward slash(\) at the end of the path even, for example C:\Program Files\Java\jdk1.7.0_10\Southeastward
Awesome. I tried all other ways but nothing works until I tried this "silly" trick. Works brilliantly on Windows 7 x64Connors
I added the path to the JAVA_HOME environment variable. The back/next trick didn't work for me, but restarting the installer executable did.Soundboard
This works on Win8 x64. Close the installer and restart it after messing with PATH and JAVA_HOME !Ganiats
Works on Win10 x64. ths sooooo much.Overrule
D
99

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?

Davison answered 7/12, 2010 at 22:12 Comment(1)
Doesn't help on win7 64bit.Hager
I
88

It seems like it doesn't work without 32 bit JDK. Just install it and be happy...

Illhumored answered 7/12, 2010 at 22:12 Comment(5)
Hmmm... I did the same but it didn't work for me. Perhaps there is an additional step that needs to be done?Monika
I have actually just had the same problem with the 32 bit JDKKarmenkarna
I'm trying to install the Android SDK with "installer_r20-windows" and it STILL refuses to accept the 64bit JDK as legitimate, even after setting the JAVA_HOME env. var. GOOGLE: FIX IT !!Kela
I had installed the Java SDK x64. It appears the Android SDK is x32. Nice one google, can you be clearer next time?Tael
Worked for me, Win7 64bit. Tried the other solutions to no avail.Talmudist
E
32

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.

Eosin answered 7/12, 2010 at 22:12 Comment(0)
S
28

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.

Swanskin answered 7/12, 2010 at 22:12 Comment(10)
I've tried all the other answers, except for this one. I'll give this a shot and report back in a couple of days.Politburo
check, right.. old and simple java class path variable ;=)))))) ps.: thx, found it via google and wanted to post it myself.. :) the dialog actually say you should do it ;) nobody reads todayPupa
Back button trick didn't worked for me, but adding PATH worked like a charm. Thank you!Spirillum
It seems that environment variable names are case insensitive on Windows 7, so when I added a 'PATH' variable it overwrote the 'Path' variable. Just a warning for anyone else who tries the same thing!Friendly
Oh, thats quite bad, i will add a warning to my answer.Swanskin
This is what worked for me (tried all the others too). This will be my first experience developing with Java/Android. Doesn't exactly feel me with confidence that this will be a pain free experience when the installer is a JOKE :|Anastase
Still didn't work for me, wonder what is wrong :( I already have the Path variable, I changed it to PATH and appended my jdk path "C:\Program Files\Java\jdk1.7.0_05\bin" to it (w/o the quotes), then tried to install android sdk, still wouldn't proceed :(Spindle
This worked for me, with one extra step. I had to rename the java.exe file in c:\windows\system32 to something else (java.exe.old for me). This made it actually check the JDK directory, and it was able to resolve it.Laccolith
Everything else failed on Win7 64 bits, I was like ok I give up but let me give this last shot. And then it worked like magic...thanksEzekiel
@Laccolith this worked for me on 64 bit Windows w/ 64 bit JDK.Canicular
D
20

Non of these solutions worked for me. I fixed it by temporarily changing the filename of C:\Windows\System32\java.exe to java_.exe

Dandy answered 7/12, 2010 at 22:12 Comment(3)
This worked in my 64 bit windows 7 with jdk7x64bit and the 20.0.3 installerHanford
WOW! Worked perfect under Windows 7 x64 without 32-bit JDK! Thanks a lot :)Dollie
Thanks! Worked for me. Crazy - what gives with all this bugginess for installing these tools on Windows?Higley
B
20

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"
Bilbrey answered 7/12, 2010 at 22:12 Comment(0)
D
19

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.

Deaver answered 7/12, 2010 at 22:12 Comment(4)
Too many java's in the path I suppose... Shouldn't it be the same java.exe in both cases though?Eiten
@Eiten there are cases where you have java installed as 32 bit and 64 bit and you have to make sure it points at first to the 64 bit versionDeaver
I didn't think java would be installed by default on a new windows machine... but there I go assuming again...Eiten
This solution worked for Windows8 x64. Tried everything else above with no luck.Gooseflesh
T
17

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..

Tedesco answered 7/12, 2010 at 22:12 Comment(0)
R
15

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 :)

Roselani answered 7/12, 2010 at 22:12 Comment(3)
This is the only one that worked for me. My value is: C:\Program Files\Java\jdk1.7.0_04Immunoreaction
i added C:/Program Files/java/jdk1.7.0 to user variables and set as JAVA-HOME. Worked for me.Vestal
This is the CORRECT way. Works fine for ma machine win7 64 bit. without JDK 32bit.Shockey
O
11

I copied the Java.exe from

C:\Windows\System32

to

C:\Windows\SysWOW64

and it worked.

I'm using 64 bit Windows 8.

Ortega answered 7/12, 2010 at 22:12 Comment(1)
You, sir, are a life saver. Can't believe these ridiculous issues still exist close to a year laterOverbearing
P
8

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. =)

Plow answered 7/12, 2010 at 22:12 Comment(1)
It worked. I was actually adding bin in the JAVA_HOME path end as well but removing it workedCati
T
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.

Timbuktu answered 7/12, 2010 at 22:12 Comment(1)
This is the one that worked for me. I had already set the environment variable, clicked back and then next, no prevail. This seemed to work. For anyone else that might be having issues, I'm using Windows 8.1, and Java JDK/JRE 8. After clicking next, it goes back to /system32/java.exe and says it was found.Nilsanilsen
P
7

Press Report error and OK. Next will be enabled.

Phlegmy answered 7/12, 2010 at 22:12 Comment(0)
D
7

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/

Dolly answered 7/12, 2010 at 22:12 Comment(1)
at the bottom, "click back", "click next" the button is now enabledAlinaaline
O
6

Also, RUN AS ADMINISTRATOR! Worked for me with backslash fix.

Overjoy answered 7/12, 2010 at 22:12 Comment(0)
T
6

Try downloading and installing the zipped version rather than the .exe installer.

Tragedy answered 7/12, 2010 at 22:12 Comment(1)
this is the biggest pile of crap fix up issue i ever seen. Its like people are trying hundred different things, one things works here and not there. Why is this such an issue esp if its from the so called big tech company "Google". I think they need to invest in fixing up their crap. rather than making autodriving cars and stuff. My setup still doesnt work. when i install the SDK it says it has found the JDK in correct folder but then the SDK manager just doesnt open no matter what! on my other PC works fine. with same setup and machinePlasmodium
A
5

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.

  1. JDK (32 bit)
  2. 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)
  3. Eclipse (32 bit) and finally ADT.

I tried it and all works fine.

Alveolus answered 7/12, 2010 at 22:12 Comment(0)
L
4

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.

Lochia answered 7/12, 2010 at 22:12 Comment(0)
L
4

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.

Lapides answered 7/12, 2010 at 22:12 Comment(0)
K
4

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...

Kathrinkathrine answered 7/12, 2010 at 22:12 Comment(0)
C
4

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.

Chippy answered 7/12, 2010 at 22:12 Comment(0)
S
4

I had the same problem and solved it by installing the x86 version of the JDK (on Windows XP x64).

Sonjasonnet answered 7/12, 2010 at 22:12 Comment(1)
You don't have to do this. Check my answer above :)Resting
S
3

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! :)

Salvia answered 7/12, 2010 at 22:12 Comment(0)
S
2

4 Different Solutions:

1) If you get above screen, just click BACK button and from previous screen click NEXT button. Actually silly, but sounds good.

2) Download SDK Manager .zip format instead of .exe and then try to install. It’s all so silly, but work like a charm.

3) If you installed 64 bit JDK means, just uninstall that and install 32-bit JDK.

4) You have to change that as following,

JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
JRE_HOME=C:/Program Files/Java/jre8
Path=%JAVA_HOME%;C:…
Salvage answered 7/12, 2010 at 22:12 Comment(0)
N
2

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.

Newly answered 7/12, 2010 at 22:12 Comment(0)
E
2

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.

Edina answered 7/12, 2010 at 22:12 Comment(0)
C
2

Yeah install the 32 bit version of the Java SE SDK (or any of the combinations). That should help solve your problem.

Conceptualize answered 7/12, 2010 at 22:12 Comment(2)
See the "back and forward" answer. That's the solution. Forget playing with the registry or installing the 32bit.Sparker
@Sparker It doesn't work in some cases. Read my answer above ;)Resting
B
1

There is too many ways for doing it:

Way number one

If Java is installed perfectly in your machine, then please close the installer and try to reinstall it.

When you open it for the second time, it will find JAVA.

Way number 2

Set up an environment variable like this-

Environment variables for java installation

And then try again.

It should work :)

Bouffe answered 7/12, 2010 at 22:12 Comment(0)
L
1

I spent a little over an hour trying just about every option presented. I eventually figured out that I had a lot of stale entries for software that I had uninstalled. I deleted all the registry nodes that had any stale data (pointed to the wrong directory). This included the

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment]

and

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]

entries as a JRE included in the JDK.

I also got rid of all the JAVA entries in my environmental variables. I guess I blame it on bad uninstallers that do not clean up after themselves.

Lentic answered 7/12, 2010 at 22:12 Comment(0)
B
1

Install both JDK 64 bit 1.6 for Windows and JRE 1.7 64bit for Windows.

It worked in my case.

Brethren answered 7/12, 2010 at 22:12 Comment(0)
O
1

You might want to restart your machine. For me, without having to use forward slashes it worked after I restarted windows.

Overprint answered 7/12, 2010 at 22:12 Comment(0)
S
1

This issue has been fixed on SDK revision 20.xxx

Download it via http://dl.google.com/android/installer_r20.0.3-windows.exe

Suzettesuzi answered 7/12, 2010 at 22:12 Comment(3)
Not true, currently running that installer with a windows 7 64bit and 64bit jdk7.0 and it still doesn't work. None of the fixes in this thread do.Hanford
It worked for me some how. Maybe you having a different issue.Suzettesuzi
No it hasn't. I've just installed installer_r22.0.1-windows.exe on Windows 7 64-bit with 64-bit JDK and I had to go through the various contortions on this thread before I found the right combination that worked for me.Maledict
O
1

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.
Osorio answered 7/12, 2010 at 22:12 Comment(0)
A
1

For Windows users:

You would set JAVA_HOME environment variable: http://wso2.org/project/wsas/java/1.1/docs/setting-java-home.html

Altonaltona answered 7/12, 2010 at 22:12 Comment(0)
Q
1

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.

Quinacrine answered 7/12, 2010 at 22:12 Comment(2)
Nope. Just do the back-and-forward as explained above.Sparker
no i have a pc where i uninstalled ALL jave jdk and jre installs, then installed ONLY 64 but JDK and JRE . and the SDK Manager worked with no probs. on my other PC i used same method and no it does not workPlasmodium
L
0

While this question has already been answered. Here is what exact steps you need to do when you are setting up for development. In general anything related to Java Development.

Setting Up Java

Make sure you are using latest jdk url

curl -L -O -H "Cookie: oraclelicense=accept-securebackup-cookie" -k "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz"
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/jdk1.7.0_67/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/jdk1.7.0_67/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/jdk1.7.0_67/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws

Setting up your system in this case ubuntu/mac

export ANDROID_HOME=/home/ashish/android-sdks
export ANDROID_SDK=/home/ashish/android-sdks
export JAVA_HOME=/usr/local/jdk1.8.0_45
export JDK_HOME=/usr/local/jdk1.8.0_45/
export JRE_HOME=/usr/local/jdk1.8.0_45/jre
export PATH=$PATH:$ANT_HOME/bin:$JAVA_HOME/bin:$JRE_HOME/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools

this contents needs to appear in .profile in ubuntu or .bash_profile in mac in home folder we can go there using cd ~

Lecithinase answered 7/12, 2010 at 22:12 Comment(0)
C
0

I add the following in the users Environment Variable( Windows 10)

JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
JRE_HOME=C:/Program Files/Java/jre8
Path=%JAVA_HOME%;C:...

And then cancel the current installation of Android Studio and start again. It worked fine this time for me. No JDK error.

Chiquitachirico answered 7/12, 2010 at 22:12 Comment(0)
D
0

I have the jdk installed on my D: drive. None of the other answers worked for me. I got it to install by creating a symbolic link from the C: drive to the installed location:

    c:
    cd "Program Files"
    mklink /d Java "d:\Program Files\Java"  

Note that the jdk (and jre) install directories are subdirectories of "Java" so upgrading is not a problem even though the name changes with the release.

Discreditable answered 7/12, 2010 at 22:12 Comment(0)
T
0

Windows 8 running the x64 SDK.

  1. Download the latest JDK from here: Oracle JDK
  2. Once downloaded and extracted go into the JDK file at C:\Program Files\Java\jdk1.7.0_80\bin and double click on the java Application file (it's the only one called just java). This will briefly open the command line.
  3. Begin the process of installing Android Studio again, from scratch. It should automatically detect the SDK now.

For whatever reason Android Studio wouldn't detect it no matter what I put in manually or searched using the browse option.

Pressing back would not work.

Reporting the error would not work.

Adding JAVA_HOME or other suggestions to the C:... would not work.

It was only beginning the installation of Android Studio again after running the java file that it worked.

Transducer answered 7/12, 2010 at 22:12 Comment(0)
S
0

For Wine users:... For reasons having to do with "unimplemented" (as in: the "find" command and the "/D" switch to "copy"), it appears that you have to cheat a bit more to get Android SDK to see JDK in Wine.

However, I have passed the hurdles and am (I suppose) obliged to share something (anything) that worked:

  1. What is responsible for finding Java is the script "tools/lib/find_java.bat". In the beginning of that file, add:

    set java_exe=%JAVA_HOME%/bin/java.exe goto :EOF

    1. To circumvent the "copy /D not implemented" issue, in "tools/android.bat" comment out (with "rem") the lines from just after

    :MkTempCopy

to just before

:EndTempCopy

You should now (if you've set JAVA_HOME) be able to run android.bat and install the SDK parts you need.

Stillborn answered 7/12, 2010 at 22:12 Comment(0)
G
0

My problem was that i run studio.exe instead of studio64.exe. I'm running Windows 8 64bits

Gerlachovka answered 7/12, 2010 at 22:12 Comment(0)
E
0

In my case problem was in JAVA_TOOL_OPTIONS environment variable. Nothing helps me until I removed it. Hope it help someone!

Ell answered 7/12, 2010 at 22:12 Comment(0)
S
0

It is bug in the Android installer. Download the latest installer and try it. Then it will work.

Shameful answered 7/12, 2010 at 22:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.