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

I am using Android Studio until I upgrade to 0.2.6. Now I can not compile or create a new project.

What's happening? I'm not sure, but I think Android Studio does not know where my sdk folder is (I mean the sdk folder, which is in my Android studio directory).

What I've done? I opened Android Studio as an administrator ( right click > open as administrator ). Then I go to Configure > Projects Defaults > Project Structure . I have only SDK (path C:\Program Files\Java\jdk1.7.0_25 ). I have not installed my SDK, then I click to add, and I find my sdk folder (sdk, which is in the android studio directory).

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

What can I do?

+6
source share
1 answer

Have you followed the instructions on the install page?

Known issue: on some Windows systems, the launcher script cannot 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 go to the Advanced tab> Environment Variables and add a new JAVA_HOME system variable pointing to your JDK folder, for example C: \ Program Files \ Java \ jdk1.7.0_21.

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

+2
source

Source: https://habr.com/ru/post/952700/


All Articles