Jprofiler无法让代理工作

时间:2018-01-23 16:26:33

标签: java spring-boot jprofiler

我正在尝试将JProfiler设置为一个非常简单的案例,看看它是如何工作的,虽然我不想使用IDE集成,但我想使用命令行。 我正在本地为启动器运行我的jar(Spring boot编译),并附加了此命令

-agentpath:/Applications/JProfiler.app/Contents/Resources/app/bin/macos/libjprofilerti.jnilib=port=8849

我只是在文档中提到的从端口8849上的JProfiler到localhost的直接网络连接,但它似乎不起作用,我无法通过某种原因连接它。 有人吗?我正在使用macOs。

1 个答案:

答案 0 :(得分:0)

If you add the -agentpath parameter after the -jar argument, it will be passed as an argument to the main class and not load the agent.

If you pass it before the -jar argument, the agent will be loaded. There will be output on stderr that is prefixed with JProfiler> that shows you some status information form the agent.

Should the JVM not be able to load the agent for any reason, for example because the path to the native library is wrong, it will print an error and exit.