tccpg288 tccpg288 - 4 months ago 28
Android Question

Cannot Point Android Studio to Java 1.8

A lot of the new Android Studio / Android features require Java 1.8.

I have followed the instructions located here, and notice that my Android Studio is not allowing me to point to the folder location containing Java 1.8. When I get to the folder where it is located, it does not let me drill down any further:

enter image description here

enter image description here

enter image description here

enter image description here

Answer

Notice the location of the currently selected Java 7 home - under /Library/Java/JavaVirtualMachines/, not /Library/Internet Plug-Ins/.

AFAIK, the applet plugin does not in itself contain an entire JDK that you can reference from Android Studio. You can verify this by looking at and comparing the contents of Contents/Home/bin in each location, the Home in Internet Plug-Ins does not contain standard Java Development Kit tools such as javac - the Java compiler tool.

What directories are inside your /Library/Java/JavaVirtualMachines/ folder? It looks like you already have Java 7, which is what's currently selected. Look for something referencing jdk1.8.0 - Java 8. If that directory is present, select it as your Java 8 JDK. If not, you don't already have the Java 8 JDK installed and you'll need to install it from here.