I'm running openSuse 12.3 and have a Java 7-compatible version installed:
user@machine:~/saug/android-studio/bin$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
However, when I launch android studio 135.1339820, it launches java 1.5.0 and therefore fails:
user@machine:~/saug/android-studio/bin$ ./studio.sh
java version "1.5.0"
gij (GNU libgcj) version 4.7.2 20130108 [gcc-4_7-branch revision 195012]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Exception in thread "main" java.lang.NoClassDefFoundError: javax.swing.UIManager
at java.lang.Class.initializeClass(libgcj.so.13)
at javax.swing.UIManager.getUI(libgcj.so.13)
at javax.swing.text.JTextComponent.updateUI(libgcj.so.13)
at javax.swing.text.JTextComponent.<init>(libgcj.so.13)
at javax.swing.JEditorPane.<init>(libgcj.so.13)
at javax.swing.JTextPane.<init>(libgcj.so.13)
at com.intellij.idea.Main.showMessage(Main.java:237)
at com.intellij.idea.Main.showMessage(Main.java:224)
at com.intellij.idea.Main.main(Main.java:87)
Is there a way to specify which java version (or path) to use? Thanks
I resolved this problem by adding this line in the studio.sh "JDK_HOME=/usr/java/latest"
#!/bin/sh
#
# ---------------------------------------------------------------------
# Android Studio startup script.
# ---------------------------------------------------------------------
#
JDK_HOME=/usr/java/latest
...
you should replace "/usr/java/latest" with your java location if not here.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.