0

I am using Android Studio 1.4.1. when I tried to open an existing project, i received the follwoing error:

Error:The supplied javaHome seems to be invalid. I cannot find the java  
executable. Tried location: C:\xxx\SDK\bin\java.exe

I do not know why Android Studion looks for the Java.exe in the SDK folder. the JDK path is specified as shown in the image

image:

enter image description here

This issue causes the all the classes of the App to be marked with a red circle with "j"letter.

Please let me know how to solve this issue

Amrmsmb
  • 1
  • 27
  • 104
  • 226
  • Possible duplicate of [Manually setting JDK path for Android Studio](http://stackoverflow.com/questions/23764903/manually-setting-jdk-path-for-android-studio) – Irfan Anwar Aug 15 '16 at 10:03

2 Answers2

0

Try to set JAVA_HOME environment variable to something like this C:\Program Files\Java\jdk1.8.0_66.

pr0gramist
  • 8,305
  • 2
  • 36
  • 48
  • i cant see any difference between the solution you provided and the image i posted...i did the same thing already – Amrmsmb Aug 15 '16 at 10:13
  • Environment variable and module setting is not the same thing. Fe. I can not even open Android Studio 2.1.2 with bad JAVA_HOME – pr0gramist Aug 15 '16 at 10:21
  • but i cant figure out what do u suggest..because what you provided is exactly the same as what i posted in the image..would you please clarify further – Amrmsmb Aug 15 '16 at 10:26
  • 1
    I mean to set env variable, not some variable in Android Studio. https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html – pr0gramist Aug 15 '16 at 10:39
0

In android studio go to file then choose PROJECT STRUCTURE and go to JDK LOCATION and choose current path of jdk (e.g. /home/vishu/android-studio/jdk1.8.0_111)

if you do not have jdk downloaded use this link- http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html download according to your OS

vishant
  • 11
  • 1