openSUSE 下运行 Jabref 出错(可能是 Java 的问题)

大家好我在 openSUSE 下运行 Jabref(文献管理软件)出错,具体如下:

linux:/opt/Jabref # java JabRef-2.10.jar
Exception in thread "main" java.lang.NoClassDefFoundError: JabRef-2.10.jar
   at gnu.java.lang.MainThread.run(libgcj.so.14)
Caused by: java.lang.ClassNotFoundException: JabRef-2.10.jar not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.14)
   at java.lang.ClassLoader.loadClass(libgcj.so.14)
   at java.lang.ClassLoader.loadClass(libgcj.so.14)
   at gnu.java.lang.MainThread.run(libgcj.so.14)

我之前网上搜过,好像大概是说需要装 JDK 还是 JRE,我到 java.com 这个页面去下载装过,也不知道是不是没下载对还是装错了。

执行的命令少了个参数吧,试试运行
java -jar JabRef-2.10.jar

linux:/opt/Jabref # java -jar JabRef-2.10.jar 

WARNING: You are running Java version 1.6 or lower (1.5.0 to be exact).
         JabRef needs at least a Java Runtime Environment 1.6 or higher.
         JabRef should not start properly and output an error message
         (probably java.lang.UnsupportedClassVersionError ... (Unsupported major.minor version 49.0)
         See http://jabref.sf.net/faq.php for more information.


WARNING: You are not running a Java version from Oracle (or Sun Microsystems).
         Your java vendor is: Free Software Foundation, Inc.
         If JabRef crashes please consider switching to an Oracle Java Runtime.
         See http://jabref.sf.net/faq.php for more information.


ERROR while starting or running JabRef:

java.awt.AWTError: Cannot load AWT toolkit: 
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.14)
   at javax.swing.plaf.basic.BasicLookAndFeel.initialize(libgcj.so.14)
   at javax.swing.UIManager.setLookAndFeel(libgcj.so.14)
   at javax.swing.UIManager.<clinit>(libgcj.so.14)
   at java.lang.Class.initializeClass(libgcj.so.14)
   at javax.swing.UIManager.getUI(libgcj.so.14)
   at javax.swing.JLabel.updateUI(libgcj.so.14)
   at javax.swing.JLabel.<init>(libgcj.so.14)
   at javax.swing.JLabel.<init>(libgcj.so.14)
   at net.sf.jabref.external.ExternalFileType.<init>(ExternalFileType.java:31)
   at net.sf.jabref.JabRefPreferences.<init>(JabRefPreferences.java:118)
   at net.sf.jabref.JabRefPreferences.getInstance(JabRefPreferences.java:143)
   at net.sf.jabref.JabRef.<init>(JabRef.java:92)
   at net.sf.jabref.JabRef.main(JabRef.java:84)
   at java.lang.reflect.Method.invoke(libgcj.so.14)
   at net.sf.jabref.JabRefMain.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: 
   at java.lang.Class.forName(libgcj.so.14)
   at java.awt.Toolkit.getDefaultToolkit(libgcj.so.14)
   ...15 more

Please first check if this problem and a solution is already known. Find our...
  * ...FAQ at http://jabref.sf.net/faq.php and our...
  * ...user mailing-list at http://sf.net/mailarchive/forum.php?forum_name=jabref-users

If you do not find a solution there, please let us know about the problem by writing a bug report.
You can find our bug tracker at http://sourceforge.net/p/jabref/bugs/

  * If the bug has already been reported there, please add your comments to the existing bug.
  * If the bug has not been reported yet, then we need the complete error message given above
    and a description of what you did before the error occured.

We also need the following information (you can copy and paste all this):
  * Java Version: 1.5.0
  * Java Vendor: Free Software Foundation, Inc.
  * Operating System: Linux (3.14.0-rc5-1-desktop)
  * Hardware Architecture: x86_64

We are sorry for the trouble and thanks for reporting problems with JabRef!

Exception in thread "main" java.lang.NoClassDefFoundError: javax.swing.UIManager
   at java.lang.Class.initializeClass(libgcj.so.14)
   at javax.swing.UIManager.getUI(libgcj.so.14)
   at javax.swing.text.JTextComponent.updateUI(libgcj.so.14)
   at javax.swing.text.JTextComponent.<init>(libgcj.so.14)
   at javax.swing.JEditorPane.<init>(libgcj.so.14)
   at net.sf.jabref.JabRefMain.main(Unknown Source)

报版本过低感觉有点奇怪,或者谁能发个链接给我吗。
我也是到 java.com 上面下载过的

linux:/opt/Jabref # zypper in libgcj.so.14                                                    
PackageKit is blocking zypper. This happens if you have an updater applet or other software management application using PackageKit running.
Tell PackageKit to quit? [yes/no] (no): yes
PackageKit is still running (probably busy).                                                           
Try again? [yes/no] (no): yes
Loading repository data...                                                                                
Reading installed packages...                                                                                    
'libgcj.so.14' not found in package names. Trying capabilities.                                                  
'libgcj48-32bit' providing 'libgcj.so.14' is already installed.                                                  
Resolving package dependencies...                                                                                  
                                                                                                                      
Nothing to do.

另外我的 64bit 的 opensuse,会不会和 32bit 有关。
之前我在 Debian 64bit 下是可以用这个东西的。

[quote=“karaisan”]
WARNING: You are not running a Java version from Oracle (or Sun Microsystems).
Your java vendor is: Free Software Foundation, Inc.
If JabRef crashes please consider switching to an Oracle Java Runtime.
See jabref.sf.net/faq.php for more information.

  • Java Version: 1.5.0
  • Java Vendor: Free Software Foundation, Inc.
  • Operating System: Linux (3.14.0-rc5-1-desktop)
  • Hardware Architecture: x86_64
    [/code]

你现在运行的 Java 不是你在 Oracle 官网下载安装的 JRE,而是 Free Software Foundation 的 openjdk。openSUSE 默认的 Java 是开源的 openjdk,要用闭源 JRE 你要用 alternative 把软链接改过来:

en.opensuse.org/SDB:Installing_Java[/quote]

我用系统自带的 openJdk 是可以打开的,版本是 1.7,不用去另外下载 jdk

software.opensuse.org/package/jabref?search_term=Jabref

我是一键安装的,一点问题都没有 :joy: 另外我也是六十四位的。

好复杂,不过我做了以下几步以后,输入 java -jar 命令就可以执行程序了,谢谢。


linux:/opt/Jabref # zypper rm icedtea-web
Loading repository data…
Reading installed packages…
Package ‘icedtea-web’ is not installed.
‘icedtea-web’ not found in package names. Trying capabilities.
No provider of ‘icedtea-web’ is installed.
Resolving package dependencies…

Nothing to do.
linux:/opt/Jabref # update-alternatives --install “/usr/bin/java” “java” “/usr/java/latest/bin/java” 1
linux:/opt/Jabref # update-alternatives --set java /usr/java/latest/bin/java
update-alternatives: using /usr/java/latest/bin/java to provide /usr/bin/java (java) in manual mode
linux:/opt/Jabref # rpm -ql jre | grep libnpjp2.so
/usr/java/jre1.7.0_60/lib/amd64/libnpjp2.so
linux:/opt/Jabref # plugin=$(rpm -ql jre | grep libnpjp2.so)
linux:/opt/Jabref # ln -sv “$plugin” /usr/lib64/browser-plugins/
‘/usr/lib64/browser-plugins/libnpjp2.so’ -> ‘/usr/java/jre1.7.0_60/lib/amd64/libnpjp2.so’
linux:/opt/Jabref # java -jar JabRef-2.10.jar
六月 11, 2014 2:35:19 下午 java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Found 2 plugin(s):

  • net.sf.jabref.export.misq (jar:file:/opt/Jabref/JabRef-2.10.jar!/plugins/net.sf.jabref.export.misq/plugin.xml)
  • net.sf.jabref.core (jar:file:/opt/Jabref/JabRef-2.10.jar!/plugins/net.sf.jabref.core/plugin.xml)

Could not get key binding for “Open folder”

无法删除系统里面的 openJDK

liangzi@tianwaifeixian:~/bin> ./java8.sh
bash: ./java8.sh: 权限不够
liangzi@tianwaifeixian:~/bin> ./java8.sh
root’s password:
gzip: /usr/java/jdk1.8.0_60/man/man1/apt.1: No such file or directory

下面的代码是我保存下来的 命名为 java8.sh 运行结果如上 不知道问题在那里了 请指教 谢谢

#!/bin/bash

sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/appletviewer.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/apt.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/extcheck.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jar.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jarsigner.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/javac.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/javadoc.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/javah.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/javap.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jcmd.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jconsole.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jdb.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jhat.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jinfo.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jmap.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jps.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jrunscript.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jsadebugd.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jstack.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jstat.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/jstatd.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/native2ascii.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/pack200.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/rmic.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/schemagen.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/serialver.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/unpack200.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/wsgen.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/wsimport.1)
sudo gzip $(readlink -f /usr/java/jdk1.8.0_60/man/man1/xjc.1)
sudo /usr/sbin/update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_60/bin/javac 3 --slave /usr/bin/appletviewer appletviewer /usr/java/jdk1.8.0_60/bin/appletviewer --slave /usr/share/man/man1/appletviewer.1.gz appletviewer.1.gz /usr/java/jdk1.8.0_60/man/man1/appletviewer.1.gz --slave /usr/bin/extcheck extcheck /usr/java/jdk1.8.0_60/bin/extcheck --slave /usr/share/man/man1/extcheck.1.gz extcheck.1.gz /usr/java/jdk1.8.0_60/man/man1/extcheck.1.gz --slave /usr/bin/jar jar /usr/java/jdk1.8.0_60/bin/jar --slave /usr/share/man/man1/jar.1.gz jar.1.gz /usr/java/jdk1.8.0_60/man/man1/jar.1.gz --slave /usr/bin/jarsigner jarsigner /usr/java/jdk1.8.0_60/bin/jarsigner --slave /usr/share/man/man1/jarsigner.1.gz jarsigner.1.gz /usr/java/jdk1.8.0_60/man/man1/jarsigner.1.gz --slave /usr/lib64/jvm/java java_sdk /usr/java/jdk1.8.0_60 --slave /usr/share/man/man1/javac.1.gz javac.1.gz /usr/java/jdk1.8.0_60/man/man1/javac.1.gz --slave /usr/bin/javadoc javadoc /usr/java/jdk1.8.0_60/bin/javadoc --slave /usr/share/man/man1/javadoc.1.gz javadoc.1.gz /usr/java/jdk1.8.0_60/man/man1/javadoc.1.gz --slave /usr/bin/javah javah /usr/java/jdk1.8.0_60/bin/javah --slave /usr/share/man/man1/javah.1.gz javah.1.gz /usr/java/jdk1.8.0_60/man/man1/javah.1.gz --slave /usr/bin/javap javap /usr/java/jdk1.8.0_60/bin/javap --slave /usr/share/man/man1/javap.1.gz javap.1.gz /usr/java/jdk1.8.0_60/man/man1/javap.1.gz --slave /usr/share/man/man1/jcmd.1.gz jcmd.1.gz /usr/java/jdk1.8.0_60/man/man1/jcmd.1.gz --slave /usr/bin/jconsole jconsole /usr/java/jdk1.8.0_60/bin/jconsole --slave /usr/share/man/man1/jconsole.1.gz jconsole.1.gz /usr/java/jdk1.8.0_60/man/man1/jconsole.1.gz --slave /usr/bin/jdb jdb /usr/java/jdk1.8.0_60/bin/jdb --slave /usr/share/man/man1/jdb.1.gz jdb.1.gz /usr/java/jdk1.8.0_60/man/man1/jdb.1.gz --slave /usr/bin/jhat jhat /usr/java/jdk1.8.0_60/bin/jhat --slave /usr/share/man/man1/jhat.1.gz jhat.1.gz /usr/java/jdk1.8.0_60/man/man1/jhat.1.gz --slave /usr/bin/jinfo jinfo /usr/java/jdk1.8.0_60/bin/jinfo --slave /usr/share/man/man1/jinfo.1.gz jinfo.1.gz /usr/java/jdk1.8.0_60/man/man1/jinfo.1.gz --slave /usr/bin/jmap jmap /usr/java/jdk1.8.0_60/bin/jmap --slave /usr/share/man/man1/jmap.1.gz jmap.1.gz /usr/java/jdk1.8.0_60/man/man1/jmap.1.gz --slave /usr/bin/jps jps /usr/java/jdk1.8.0_60/bin/jps --slave /usr/share/man/man1/jps.1.gz jps.1.gz /usr/java/jdk1.8.0_60/man/man1/jps.1.gz --slave /usr/bin/jrunscript jrunscript /usr/java/jdk1.8.0_60/bin/jrunscript --slave /usr/share/man/man1/jrunscript.1.gz jrunscript.1.gz /usr/java/jdk1.8.0_60/man/man1/jrunscript.1.gz --slave /usr/bin/jsadebugd jsadebugd /usr/java/jdk1.8.0_60/bin/jsadebugd --slave /usr/share/man/man1/jsadebugd.1.gz jsadebugd.1.gz /usr/java/jdk1.8.0_60/man/man1/jsadebugd.1.gz --slave /usr/bin/jstack jstack /usr/java/jdk1.8.0_60/bin/jstack --slave /usr/share/man/man1/jstack.1.gz jstack.1.gz /usr/java/jdk1.8.0_60/man/man1/jstack.1.gz --slave /usr/bin/jstat jstat /usr/java/jdk1.8.0_60/bin/jstat --slave /usr/share/man/man1/jstat.1.gz jstat.1.gz /usr/java/jdk1.8.0_60/man/man1/jstat.1.gz --slave /usr/bin/jstatd jstatd /usr/java/jdk1.8.0_60/bin/jstatd --slave /usr/share/man/man1/jstatd.1.gz jstatd.1.gz /usr/java/jdk1.8.0_60/man/man1/jstatd.1.gz --slave /usr/bin/native2ascii native2ascii /usr/java/jdk1.8.0_60/bin/native2ascii --slave /usr/share/man/man1/native2ascii.1.gz native2ascii.1.gz /usr/java/jdk1.8.0_60/man/man1/native2ascii.1.gz --slave /usr/bin/pack200 pack200 /usr/java/jdk1.8.0_60/bin/pack200 --slave /usr/share/man/man1/pack200.1.gz pack200.1.gz /usr/java/jdk1.8.0_60/man/man1/pack200.1.gz --slave /usr/bin/rmic rmic /usr/java/jdk1.8.0_60/bin/rmic --slave /usr/share/man/man1/rmic.1.gz rmic.1.gz /usr/java/jdk1.8.0_60/man/man1/rmic.1.gz --slave /usr/bin/schemagen schemagen /usr/java/jdk1.8.0_60/bin/schemagen --slave /usr/share/man/man1/schemagen.1.gz schemagen.1.gz /usr/java/jdk1.8.0_60/man/man1/schemagen.1.gz --slave /usr/bin/serialver serialver /usr/java/jdk1.8.0_60/bin/serialver --slave /usr/share/man/man1/serialver.1.gz serialver.1.gz /usr/java/jdk1.8.0_60/man/man1/serialver.1.gz --slave /
usr/bin/unpack200 unpack200 /usr/java/jdk1.8.0_60/bin/unpack200 --slave /usr/share/man/man1/unpack200.1.gz unpack200.1.gz /usr/java/jdk1.8.0_60/man/man1/unpack200.1.gz --slave /usr/bin/wsgen wsgen /usr/java/jdk1.8.0_60/bin/wsgen --slave /usr/share/man/man1/wsgen.1.gz wsgen.1.gz /usr/java/jdk1.8.0_60/man/man1/wsgen.1.gz --slave /usr/bin/wsimport wsimport /usr/java/jdk1.8.0_60/bin/wsimport --slave /usr/share/man/man1/wsimport.1.gz wsimport.1.gz /usr/java/jdk1.8.0_60/man/man1/wsimport.1.gz --slave /usr/bin/xjc xjc /usr/java/jdk1.8.0_60/bin/xjc --slave /usr/share/man/man1/xjc.1.gz xjc.1.gz /usr/java/jdk1.8.0_60/man/man1/xjc.1.gz