Denis Voloshin
Denis Voloshin

Reputation: 798

Android Studio startup configuration

Any help to feature out how to setup Android Studio startup configuration params will be appreciated. I have Android Studio 2.2 running on MAC, plus installed SDK on /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home. My problem that the current Android Studio instance is running by referencing to the embedded JDK which lacks essential jars I need for proper plugin operation.

Looking at this IDE log I see the following

    2016-09-21 07:54:03,906 [      0]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ 
2016-09-21 07:54:03,936 [     30]   INFO -        #com.intellij.idea.Main - IDE: Android Studio (build #AI-145.3276617, 15 Sep 2016 00:00) 
2016-09-21 07:54:03,936 [     30]   INFO -        #com.intellij.idea.Main - OS: Mac OS X (10.11.6, x86_64) 
2016-09-21 07:54:03,936 [     30]   INFO -        #com.intellij.idea.Main - JRE: 1.8.0_76-release-b03 (JetBrains s.r.o) 
2016-09-21 07:54:03,936 [     30]   INFO -        #com.intellij.idea.Main - JVM: 25.76-b03 (OpenJDK 64-Bit Server VM) 
2016-09-21 07:54:03,943 [     37]   INFO -        #com.intellij.idea.Main - JVM Args: -Dfile.encoding=UTF-8 -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -da -Djna.nosys=true -Djna.boot.library.path=  -Djna.debug_load=true -Djna.debug_load.jna=true -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Xverify:none -Xbootclasspath/a:../lib/boot.jar -Xms256m -Xmx1280m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=240m -XX:+UseCompressedOops -Djb.vmOptionsFile=/Applications/Android Studio.app/Contents/bin/studio.vmoptions -Didea.java.redist=Bundled -Didea.home.path=/Applications/Android Studio.app/Contents -Didea.executable=studio -Didea.platform.prefix=AndroidStudio -Didea.paths.selector=AndroidStudio2.2 
2016-09-21 07:54:03,943 [     37]   INFO -        #com.intellij.idea.Main - ext: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext: [cldrdata.jar, dnsns.jar, jaccess.jar, localedata.jar, meta-index, nashorn.jar, sunec.jar, sunjce_provider.jar, sunpkcs11.jar, zipfs.jar] 
2016-09-21 07:54:03,944 [     38]   INFO -        #com.intellij.idea.Main - ext: /System/Library/Java/Extensions: [MRJToolkit.jar]

I need ether to reset the following line ext: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext: to make it to refer to jdk1.8.0_77.jdk or to add an extra ext entry to the startup configuration.

Thanks a lot

Upvotes: 0

Views: 563

Answers (2)

Denis Voloshin
Denis Voloshin

Reputation: 798

Eventually I found how it's possible to handle this. I had to add java.ext.dirs JVM parameter to studio.vmoptions file to instruct the luncher where to lookup for extra libs

-Djava.ext.dirs=/Library/Java/JavaVirtualMachines/JDK-VERSION/Contents/Home/jre/lib/ext

Upvotes: 0

Baris Demiray
Baris Demiray

Reputation: 1607

You can point a custom JDK by adding the the environment variable STUDIO_JDK.

export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_77..

See http://tools.android.com/tech-docs/configuration/osx-jdk

Upvotes: 1

Related Questions