我有一个作为win-service运行的应用程序(使用Apache-Procrun).我想用JVisualVM监视该应用程序.我--openpid <PID>没有成功使用命令行参数,具有讽刺意味的是,旧的JConsole设法连接到该应用程序.

我还检查%TMP%\hsperfdata_username了JVisualVM- 故障排除指南中描述的-Directory的所有问题.一切都很好.
如何让JVisualVM监控我的应用程序?
在我的应用程序中,我想与 Arduino 板进行一些通信。为了实现串口通信,我想结合使用Netty框架和RXTX传输库。
所以我在 Gradle 构建配置中添加了以下几行:
dependencies {
compile group: 'io.netty', name: 'netty-all', version: '4.1.5.Final'
compile group: 'io.netty', name: 'netty-transport-rxtx', version: '4.1.5.Final'
...
}
Run Code Online (Sandbox Code Playgroud)
现在解决了编译时依赖项,我可以构建项目而不会出现任何错误。
我的构建配置使用以下命令生成了一个可执行 JAR:
jar {
manifest {
attributes 'Main-Class': 'de.project.Main',
'Implementation-Title': 'My Project',
'Implementation-Version': version
}
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是因为 RXTX 库使用本机库,所以在执行代码时出现以下异常:
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:870) …Run Code Online (Sandbox Code Playgroud)