首页 > 解决方案 > VisualVM 无​​法在 Ubuntu 18.04 上启动

问题描述

sudo apt install visualvmVisualVM在 Ubuntu 18.04 上安装后无法启动。它根本什么都不做。

启动它会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) 

安装 JDK 后问题依然存在sudo apt install default-jdk

标签: javaubuntuvisualvmubuntu-18.04

解决方案


我自己想通了。它安装了错误版本的 OpenJDK。Ubuntu 上的“default-jdk”包似乎是“无头”版本(openjdk-8-jdk-headless)。为了让 VisualVM 工作,我卸载了 OpenJDK 的无头版本并安装了 OpenJDK 减去无头版本。

sudo apt remove openjdk-8-jdk-headless
sudo apt install openjdk-8-jdk

推荐阅读