java – VisualVM无法在Ubuntu 18.04上启动
作者:互联网
在Ubuntu 18.04上使用sudo apt install visualvm安装后,VisualVM无法启动.它什么都不做.
使用visualvm -J-Djava.util.logging.config.file = logging-jconsole.properties启动它会产生以下错误消息:
java.lang.UnsatisfiedLinkError: no splashscreen in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at java.awt.SplashScreen$1.run(SplashScreen.java:124)
at java.awt.SplashScreen$1.run(SplashScreen.java:122)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.SplashScreen.getSplashScreen(SplashScreen.java:121)
at org.netbeans.core.startup.Splash.<init>(Unknown Source)
at org.netbeans.core.startup.Splash.getInstance(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)
使用sudo apt install default-jdk安装JDK后问题仍然存在.
解决方法:
我自己想通了.它安装了错误版本的OpenJDK. Ubuntu上的“default-jdk”软件包似乎是“无头”版本(openjdk-8-jdk-headless).为了让VisualVM工作,我卸载了OpenJDK的无头版本并安装了OpenJDK减去无头.
sudo apt remove openjdk-8-jdk-headless
sudo apt install openjdk-8-jdk
标签:ubuntu,java,visualvm,ubuntu-18-04 来源: https://codeday.me/bug/20190607/1194570.html