Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Android Studio with Java 1.7

I was trying to get Android Studio to use Java 1.7 on Mac OS X (Mountain Lion)

I went to File > Project Structure... and then tried to add a JDK with the + button and then selecting JDK.

I navigated to /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home and selected that, but nothing happens. (this is where Oracle's Java updater installed Java 7 automatically)

How do I use Java 1.7 with Android Studio?

like image 209
Jonathan Lin Avatar asked May 19 '13 15:05

Jonathan Lin


People also ask

Which Java version should I use for Android Studio?

A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.

Is Java 1.7 the same as Java 7?

all the way to 1.7, also known as Java 7) usually contain improvements to both the JVM and the standard library, so the two usually need to run together, and are packaged together in the JRE. If you are running any Java program on your computer, you have a JRE installed. The JDK is the Java Development Kit.

Can I use JDK 17 for Android Studio?

As per the docs, JDK 17 isn't supported yet in Android Studio. Actually, JDK 11 was supported starting from version 4.2 which was released in April 2021.

What version of Java does Android use?

Class libraryJava 8 source code that works in latest version of Android, can be made to work in older versions of Android.


1 Answers

For those wonder how you start the actual program Android Studio with Java 7: edit the plist located in /Applications/Android Studio.app/Contents/Info.plist

Change the xml key JVMVersion which is 1.6* to 1.7* (Java 7) or 1.6+ (latest version)

I don't know if there are any problems by doing this so take it easy.

like image 58
Perty Avatar answered Sep 22 '22 21:09

Perty