リモートの Debian Squeeze サーバーがあります。Oracle JDK を手動でインストールし、パス1.7.0_07
内のすべてのバイナリの代替を構成しました。jdk/bin
また、グローバル JAVA_HOME 変数をエクスポートしました。
# java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode)
#
サーバーにはGnomeが搭載されており、パテで接続してX-Windows forwarding
有効にしています。しかし、コマンドでVisualVMを起動しようとするjvisualvm
と、5〜10秒の一時停止で何も得られません:
# jvisualvm
#
ヘルプを表示しようとすると、例外が表示されます。
# jvisualvm --help
Usage: /usr/java/jdk1.7.0_07/bin/../lib/visualvm//platform/lib/nbexec {options} arguments
General options:
--help show this help
--jdkhome <path> path to Java(TM) 2 SDK, Standard Edition
-J<jvm_option> pass <jvm_option> to JVM
--cp:p <classpath> prepend <classpath> to classpath
--cp:a <classpath> append <classpath> to classpath
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.core.startup.Splash$SplashComponent
at org.netbeans.core.startup.Splash.<init>(Splash.java:111)
at org.netbeans.core.startup.Splash.getInstance(Splash.java:64)
at org.netbeans.core.startup.Main.setStatusText(Main.java:47)
at org.netbeans.core.startup.NbEvents.setStatusText(NbEvents.java:384)
at org.netbeans.core.startup.NbEvents.logged(NbEvents.java:159)
at org.netbeans.Events.log(Events.java:127)
at org.netbeans.core.startup.ModuleList.readInitial(ModuleList.java:129)
at org.netbeans.core.startup.ModuleSystem.readList(ModuleSystem.java:241)
at org.netbeans.core.startup.CLICoreBridge.usage(CLICoreBridge.java:69)
at org.netbeans.CLIHandler.showHelp(CLIHandler.java:125)
at org.netbeans.CLIHandler.checkHelp(CLIHandler.java:179)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:530)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:346)
at org.netbeans.MainImpl.execute(MainImpl.java:151)
at org.netbeans.MainImpl.main(MainImpl.java:46)
at org.netbeans.Main.main(Main.java:39)
その例外をグーグルで調べたところ、ライブラリが見つからないことがわかりましたが、以前にlibxtst-dev
インストールしました。
では、何が問題なのか、どうすれば何がうまくいかないのかを理解できますか?
アップデート:
- 私はルートの下で働いています。
- システムに他のバージョンの JDK はありません。デフォルトの OpenJDK は
apt-get purge
. - システム変数
CLASSPATH
が空ですが、問題はありますか?
UPDATE2:
libXtst
にある/usr/lib
root@test:/usr/lib# ls -la /usr/lib | grep libXtst
-rw-r--r-- 1 root root 26666 Июн 23 2010 libXtst.a
lrwxrwxrwx 1 root root 16 Окт 7 01:18 libXtst.so -> libXtst.so.6.1.0
lrwxrwxrwx 1 root root 16 Окт 6 20:26 libXtst.so.6 -> libXtst.so.6.1.0
-rw-r--r-- 1 root root 23616 Июн 23 2010 libXtst.so.6.1.0
libXext
も入っています/usr/lib
root@test:~# ls -la /usr/lib | grep libXext
-rw-r--r-- 1 root root 118668 Июл 11 2010 libXext.a
lrwxrwxrwx 1 root root 16 Окт 6 22:26 libXext.so -> libXext.so.6.4.0
lrwxrwxrwx 1 root root 16 Май 21 13:42 libXext.so.6 -> libXext.so.6.4.0
-rw-r--r-- 1 root root 74432 Июл 11 2010 libXext.so.6.4.0
root@test:~#
ここにコマンドの出力がありますjvisualvm -J-Dnetbeans.logger.console=true
root@test:~# jvisualvm -J-Dnetbeans.logger.console=true
-------------------------------------------------------------------------------
>Log Session: Monday, October 8, 2012 10:48:32 PM MSK
>System Info:
Product Version = Java VisualVM
Operating System = Linux version 2.6.32-5-amd64 running on i386
Java; VM; Vendor = 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 1.7.0_07-b10
Java Home = /usr/java/jdk1.7.0_07/jre
System Locale; Encoding = ru_RU (visualvm); UTF-8
Home Directory = /root
Current Directory = /root
User Directory = /root/.visualvm/7u6
Cache Directory = /root/.visualvm/7u6/var/cache
Installation = /usr/java/jdk1.7.0_07/lib/visualvm/visualvm
/usr/java/jdk1.7.0_07/lib/visualvm/profiler
/usr/java/jdk1.7.0_07/lib/visualvm/platform
Boot & Ext. Classpath = /usr/java/jdk1.7.0_07/jre/lib/resources.jar:/usr/java/jdk1.7.0_07/jre/lib/rt.jar:/usr/java/jdk1.7.0_07/jre/lib/sunrsasign.jar:/usr/java/jdk1.7.0_07/jre/lib/jsse.jar:/usr/java/jdk1.7.0_07/jre/lib/jce.jar:/usr/java/jdk1.7.0_07/jre/lib/charsets.jar:/usr/java/jdk1.7.0_07/jre/lib/jfr.jar:/usr/java/jdk1.7.0_07/jre/classes:/usr/java/jdk1.7.0_07/jre/lib/ext/zipfs.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/dnsns.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/localedata.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/sunpkcs11.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/sunec.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/sunjce_provider.jar
Application Classpath = /usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/boot.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/org-openide-modules.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/org-openide-util.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/org-openide-util-lookup.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/boot_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/boot_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-modules_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-modules_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util-lookup_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/dt.jar:/usr/java/jdk1.7.0_07/lib/tools.jar
Startup Classpath = /usr/java/jdk1.7.0_07/lib/visualvm/platform/core/org-openide-filesystems.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/core.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/core_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/org-openide-filesystems_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/core_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/org-openide-filesystems_zh_CN.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/com-sun-tools-visualvm-modules-startup.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_ja.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/locale/core_visualvm.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_zh_CN.jar
-------------------------------------------------------------------------------
java.lang.UnsatisfiedLinkError: /usr/java/jdk1.7.0_07/jre/lib/i386/xawt/libmawt.so: libXext.so.6: Unable to open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:77)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
at org.netbeans.core.startup.Main.start(Main.java:203)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:84)
at java.lang.Thread.run(Thread.java:722)
更新 3 Java デモをダウンロードし、SwingSet2 を起動しようとしました。
root@test:/tmp/jdk1.7.0_06# java -jar demo/jfc/SwingSet2/SwingSet2.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.7.0_07/jre/lib/i386/xawt/libmawt.so: libXext.so.6: unbale to open shared object file: no such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1648)
at java.awt.Toolkit.<clinit>(Toolkit.java:1670)
at java.awt.Component.<clinit>(Component.java:595)
更新 4
最後に、私の間違いはJDKのバージョンにありました。受け入れられた回答を参照してください。