After upgrading to Ubuntu 18.10 VisualVM 1.3.9-1 cannot start. It was installed through the package manager and I don't really want to install manually. I tried opening it with logging like:
visualvm -J-Djava.util.logging.config.file=logging-jconsole.properties
And it gives this output
java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
at org.netbeans.core.startup.layers.BinaryFS.<init>(Unknown Source)
at org.netbeans.core.startup.layers.BinaryCacheManager.load(Unknown Source)
at org.netbeans.core.startup.layers.LayerCacheManager$1Updater.run(Unknown Source)
at org.openide.filesystems.EventControl.runAtomicAction(Unknown Source)
at org.openide.filesystems.FileSystem.runAtomicAction(Unknown Source)
at org.openide.filesystems.FileUtil.runAtomicAction(Unknown Source)
at org.netbeans.core.startup.layers.LayerCacheManager.store(Unknown Source)
at org.netbeans.core.startup.layers.ModuleLayeredFileSystem.setURLs(Unknown Source)
at org.netbeans.core.startup.layers.ModuleLayeredFileSystem.addURLs(Unknown Source)
at org.netbeans.core.startup.NbInstaller.loadLayers(Unknown Source)
at org.netbeans.core.startup.NbInstaller.loadImpl(Unknown Source)
at org.netbeans.core.startup.NbInstaller.access$000(Unknown Source)
at org.netbeans.core.startup.NbInstaller$1.run(Unknown Source)
at org.openide.filesystems.FileUtil$2.run(Unknown Source)
at org.openide.filesystems.EventControl.runAtomicAction(Unknown Source)
at org.openide.filesystems.FileSystem.runAtomicAction(Unknown Source)
at org.openide.filesystems.FileUtil.runAtomicAction(Unknown Source)
at org.openide.filesystems.FileUtil.runAtomicAction(Unknown Source)
at org.netbeans.core.startup.NbInstaller.load(Unknown Source)
at org.netbeans.ModuleManager.enable(Unknown Source)
at org.netbeans.ModuleManager.enable(Unknown Source)
at org.netbeans.core.startup.ModuleList.installNew(Unknown Source)
at org.netbeans.core.startup.ModuleList.trigger(Unknown Source)
at org.netbeans.core.startup.ModuleSystem.restore(Unknown Source)
at org.netbeans.core.startup.Main.getModuleSystem(Unknown Source)
at org.netbeans.core.startup.Main.getModuleSystem(Unknown Source)
at org.netbeans.core.startup.Main.start(Unknown Source)
at org.netbeans.core.startup.TopThreadGroup.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)
The Javas installed on the system are as follows
matthew@matthew-Kratos:~$ ls /usr/lib/jvm/
default-java java-11-openjdk-amd64 java-8-openjdk-amd64
java-1.11.0-openjdk-amd64 java-1.8.0-openjdk-amd64 java-9-openjdk-amd64
matthew@matthew-Kratos:~$ dpkg-query -l | grep openjdk
ii openjdk-11-jdk:amd64 11.0.1+13-2ubuntu1 amd64 OpenJDK Development Kit (JDK)
ii openjdk-11-jdk-headless:amd64 11.0.1+13-2ubuntu1 amd64 OpenJDK Development Kit (JDK) (headless)
ii openjdk-11-jre:amd64 11.0.1+13-2ubuntu1 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-11-jre-headless:amd64 11.0.1+13-2ubuntu1 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
ii openjdk-8-jdk:amd64 8u191-b12-0ubuntu0.18.10.1 amd64 OpenJDK Development Kit (JDK)
ri openjdk-8-jdk-headless:amd64 8u191-b12-0ubuntu0.18.10.1 amd64 OpenJDK Development Kit (JDK) (headless)
ii openjdk-8-jre:amd64 8u191-b12-0ubuntu0.18.10.1 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-8-jre-headless:amd64 8u191-b12-0ubuntu0.18.10.1 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
rc openjdk-9-jre-headless:amd64 9~b161-1 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
I get the same error with Debian unstable and visualvm 1.3.9 as well as 1.4.2.
The workaround that helped for me was to use the following (i.e. the same answer as provided by Tomas Hurka):
visualvm --jdkhome /usr/lib/jvm/java-11-openjdk-amd64
Of course, for this to work you need to install openjdk-11-jdk. Your path might need to be adjusted for your system; the idea is to run with a Java 9 or newer runtime.
(For reference, I think the underlying Debian bug in my case is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897945)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With