[英]android studio 135.1339820 launches wrong java version on openSuse 12.3
I'm running openSuse 12.3 and have a Java 7-compatible version installed: 我正在运行openSuse 12.3,并安装了与Java 7兼容的版本:
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: 但是,当我启动android studio 135.1339820时,它启动了Java 1.5.0,因此失败了:
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? 有没有一种方法可以指定要使用的Java版本(或路径)? Thanks
谢谢
I resolved this problem by adding this line in the studio.sh "JDK_HOME=/usr/java/latest" 我通过在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. 如果不在此处,则应使用Java位置替换“ / usr / java / latest”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.