java - VisualVM 无法在 Ubuntu 18.04 上启动
问题描述
sudo apt install visualvm
VisualVM在 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
。
解决方案
我自己想通了。它安装了错误版本的 OpenJDK。Ubuntu 上的“default-jdk”包似乎是“无头”版本(openjdk-8-jdk-headless)。为了让 VisualVM 工作,我卸载了 OpenJDK 的无头版本并安装了 OpenJDK 减去无头版本。
sudo apt remove openjdk-8-jdk-headless
sudo apt install openjdk-8-jdk
推荐阅读
- react-native - 如何将 React Native 版本从 0.60.4 降级到 0.59
- css - 怎样去除描边边框
- java - Spring Boot Data JPA 嵌套 DTO 对象映射
- c# - ASP.Net Core Web API 和持久性基本身份验证
- javascript - 如何在不使用 react-router 的情况下知道刷新页面之前正在渲染哪个组件?
- amazon-web-services - 如何在不关闭实例的情况下减小 Amazon EBS 中的实例大小?(Linux 系统)
- angular - 如何在 InAppBrowser (Ionic 4 Cordova) 中显示计时器
- sql - 如果右侧包含特定内容,如何从多对多返回任何内容?
- python - 如何将获取值传递给views.py中的特定模型字段
- awk - 比较两个文件中的两列并打印两个输入文件中的列混合