title: VisualVM can not start
body: <p>I have a remote Debian Squeeze server. I've installed Oracle JDK <code>1.7.0_07</code> manually and configured alternatives to every binary in <code>jdk/bin</code> path. Also i exported the global JAVA_HOME variable.</p>
  
  <pre><code># 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)
  #
  </code></pre>
  
  <p>Server has Gnome on board and I'm connecting with putty and <code>X-Windows forwarding</code> enabled.
  But when I'm trying to launch VisualVM with <code>jvisualvm</code> command I just get nothing with 5-10 sec pause:</p>
  
  <pre><code># jvisualvm
  #
  </code></pre>
  
  <p>And when I try to show help, I see an Exception:</p>
  
  <pre><code># jvisualvm --help
  Usage: /usr/java/jdk1.7.0_07/bin/../lib/visualvm//platform/lib/nbexec {options} arguments
  
  General options:
    --help                show this help
    --jdkhome &lt;path&gt;      path to Java(TM) 2 SDK, Standard Edition
    -J&lt;jvm_option&gt;        pass &lt;jvm_option&gt; to JVM
  
    --cp:p &lt;classpath&gt;    prepend &lt;classpath&gt; to classpath
    --cp:a &lt;classpath&gt;    append &lt;classpath&gt; 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.&lt;init&gt;(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)
  </code></pre>
  
  <p>I <a href="http://java.net/projects/visualvm/lists/users/archive/2012-09/message/2" rel="noreferrer">googled</a> that exception and found out that the <code>libxtst-dev</code> library is missing, but I installed it previously.</p>
  
  <p>So what is the problem, how can I figure out what is going wrong?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <ul>
  <li>I'm working under root. </li>
  <li>I don't have other versions of JDK in the system, the default OpenJDK was removed with <code>apt-get purge</code>. </li>
  <li>My <code>CLASSPATH</code> system variable is empty, is it a problem?</li>
  </ul>
  
  <p><strong>UPDATE2:</strong>
  <code>libXtst</code> is in <code>/usr/lib</code></p>
  
  <pre><code>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 -&gt; libXtst.so.6.1.0
  lrwxrwxrwx   1 root root       16 Окт  6 20:26 libXtst.so.6 -&gt; libXtst.so.6.1.0
  -rw-r--r--   1 root root    23616 Июн 23  2010 libXtst.so.6.1.0
  </code></pre>
  
  <p><code>libXext</code> is also in <code>/usr/lib</code></p>
  
  <pre><code>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 -&gt; libXext.so.6.4.0
  lrwxrwxrwx   1 root root       16 Май 21 13:42 libXext.so.6 -&gt; libXext.so.6.4.0
  -rw-r--r--   1 root root    74432 Июл 11  2010 libXext.so.6.4.0
  root@test:~#
  </code></pre>
  
  <p>here is output for command <code>jvisualvm -J-Dnetbeans.logger.console=true</code></p>
  
  <pre><code>root@test:~# jvisualvm -J-Dnetbeans.logger.console=true
  -------------------------------------------------------------------------------
  &gt;Log Session: Monday, October 8, 2012 10:48:32 PM MSK
  &gt;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 &amp; 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.&lt;clinit&gt;(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)
  </code></pre>
  
  <p><strong>UPDATE 3</strong>
  I downloaded Java demos and tried to launch SwingSet2:</p>
  
  <pre><code>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.&lt;clinit&gt;(Toolkit.java:1670)
          at java.awt.Component.&lt;clinit&gt;(Component.java:595)
  </code></pre>
  
  <p><strong>UPDATE 4</strong></p>
  
  <p>finally my mistake was in the version of JDK, see accepted answer.</p>