Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio IDE with private jre/jdk? OSX

I'm running OSX 10.8 and was trying to run the Android Studio app bundle using a private jdk rather than one that is globally installed.

EDIT: I don't have any java installation globally accessible.

I have done this successfully in the past with Eclipse by editing the plist.info file and specifying what JRE/JDK I want to use via the eclipse.ini file.

I haven't found the magic on how to do this with Android Studio.

After editing the plist file unsuccessfully I opened a terminal and added the JDK/bin directory to the PATH and set a JAVA_HOME but that wasn't enough for the idea_applauncher to find a Java installation where I had specified.

I'm not sure what else I could try to make this happen. Any ideas?

EDIT: I don't have enough rep to post a screenshot, but below that what the command-line looks like with the output.

When I try to run the bundle I get a pop-up window saying there's no JDK installed and it has two buttons asking me to either "Install" or "Not Now"

$ ./idea_appLauncher

No Java runtime present, requesting install.

like image 713
CraneStyle Avatar asked May 16 '13 17:05

CraneStyle


2 Answers

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.

like image 50
jeudyx Avatar answered Oct 27 '22 00:10

jeudyx


$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
$ open /Applications/Android\ Studio.app

here is explain link

like image 34
Dartan Li Avatar answered Oct 27 '22 00:10

Dartan Li