When opening Intelli J or Android Studio after the Mavericks update nothing happens, fails silently.
Java and javac all work from the command line.
Opening the apps from the command line gives this error:
LSOpenURLsWithRole() failed with error -10658 for the file /Applications/Android Studio.app.
Opening Intelli J's idea_appLauncher
(/Applications/...app/Contents/MacOS/idea_appLauncher) from the command line gave away some more information:
someuser@machine:~$ /Applications/IntelliJ\ IDEA\ 12\ CE.app/Contents/MacOS/idea_appLauncher ; exit; No Java runtime present, requesting install. logout
[Process completed]
Obviosuly Mavericks is not picking up on my Java installation even if it's part of PATH and JAVA_HOME is set and it's not giving the "Please install Java runtime" prompt.
In my case I saw a similar error but with different error code:
LSOpenURLsWithRole() failed for the application /Applications/IntelliJ IDEA 13 CE.app with error -10810.
This worked for me: just edit the file /Applications/IntelliJ\ IDEA\ 13\ CE.app/Contents/Info.plist
and change the key field JVMVersion
from 1.6*
to 1.7*
.
My stack:
Solution:
Download and install the Java Runtime manually.
You also need to enable application from all sources from Settings/Security & Privacy.
This is due to android studio/intellij is still using the old "JavaLaunching" framework which has deprecated with Java 7. Either you install an End-Of-Life version of JDK 6, or request Android Studio to upgrade to use oracle's JDK appbundle.
I really hate to install a JAVA 6 so I'll have two JDKs on my machine. so I hacked the Android studio files such that they can be launched from the dock:
/Applications/Android Studio.app/Contents/MacOS
) file from a JavaLauncher stub to a shell script, here's how it look like:#!/bin/bash export JAVA_HOME=`/usr/libexec/java_home` echo JAVA_HOME=$JAVA_HOME export APP_PACKAGE='/Applications/Android Studio.app' exec $JAVA_HOME/bin/java -cp $JAVA_HOME/lib/tools.jar:"$APP_PACKAGE"/lib/bootstrap.jar:"$APP_PACKAGE"/lib/extensions.jar:"$APP_PACKAGE"/lib/util.jar:"$APP_PACKAGE"/lib/jdom.jar:"$APP_PACKAGE"/lib/log4j.jar:"$APP_PACKAGE"/lib/trove4j.jar:"$APP_PACKAGE"/lib/jna.jar -Didea.platform.prefix=AndroidStudio -Didea.paths.selector=AndroidStudioPreview -Dfile.encoding=UTF-8 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+UseCodeCacheFlushing -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:"$APP_PACKAGE"/lib/boot.jar -XX:MaxPermSize=256m -Xdock:icon="$APP_PACKAGE"/Contents/Resources/AndroidStudio.icns com.intellij.idea.Main
make sure to chmod +x ./studio
to it.
/Applications/Android Studio.app/Contents
directory. Otherwise, Apple will still ask you to install JDK 6: edit the file and remove the whole java section. The diff will look like: http://pastebin.com/QS8M45cr
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