Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The selected directory is not a valid home for JDK" Android Studio

I have been using Android Studio until I updated to 0.2.6. Now, I can't compile or create a new project.

What happens? I am not sure but I think Android Studio does not know where is my sdk folder (I mean sdk folder that is into my android studio directory).

What I did? I have opened Android Studio as administrator (right click > open as administrator). Then I go to Configure > Projects Defaults > Project Structure. I have only a SDK (path is C:\Program Files\Java\jdk1.7.0_25). I haven't set my SDK then I click to add and I find my sdk (sdk folder that is into android studio directory).

Ok... result: The selected directory is not a valid home for JDK.

What can i do?

like image 473
HowToAndroid Avatar asked Aug 29 '13 00:08

HowToAndroid


1 Answers

Did you follow the instructions on the install page?

Known issue: On some Windows systems, the launcher script does not find where Java is installed. If you encounter this problem, you need to set an environment variable indicating the correct location. Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21.

Make sure you have a JAVA_HOME environment variable point to the correct path (C:\Program Files\Java\jdk1.7.0_25 in your case)

like image 109
hoss Avatar answered Nov 09 '22 20:11

hoss