Installing AndroidStudio 2.0 on OS X El Capitan: if I install JRE 7 from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html, I will not receive Public Updates; if I install JRE 8, Android Studio complains that it cannot use secure connection to receive upgrades:
Is there a way to convince AS that JRE 8 is not JRE 6? If impossible, which compromise is preferable: downgrade to JRE 7 and establish secure connection for Android Studio upgrades, or keep the latest JRE and wait for Android Studio fix?
Determining the JRE Version Installed on macOS Only one JRE can be installed on the system at any time. Installing a JRE removes the previously installed JRE. The JRE version installed on the system can be determined in one of two ways: From System Preferences, and then the Other section, click the Java icon.
Android Studio is a customized version of JetBrains' IntelliJ IDE, which is, in turn, a Java application. Therefore, as we established, to launch IntelliJ (and, consequently, Android Studio) on your computer, you need to have JRE installed.
To install Android Studio on your Mac, proceed as follows: Launch the Android Studio DMG file. Drag and drop Android Studio into the Applications folder, then launch Android Studio. Select whether you want to import previous Android Studio settings, then click OK.
Android Studio requires two different JDKs: The version of Java that the IDE itself runs with. The version of the JDK that it uses to get the Java compiler from.
From the documentation, by default Android Studio is launched from java 6: http://tools.android.com/tech-docs/configuration/osx-jdk
As it is mentioned you can export an env variable to indicate Android Studio what jdk to use :
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk<version>.jdk
In order to keep this env variable accessible from the GUI, you can add the following line to your ~/.profile file :
launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk<version>.jdk
Hope it helps.
Another solution for OSX: go to the Applications folder, right click on Android Studio, choose "Show Package Contents".
Open the Info.plist file. Locate the JVMVersion key, and set the string value you need.
In my case, I needed to be 1.7 and up to be able to run the RoboVM plugin, and the value was 1.6*,1.7+, so I left it only on 1.7+.
Restart Android Studio and it should be using the version of the JVM you need.
This works if you have root access on your Mac.
In Android Studio 2.1.2 and below,the default settings is '1.6*,1.7+'.
In the latest version of Android Studio(2.2 Preview 7),the default settings is '1.8*,1.8+'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With