我无法使用以下命令在 Linux 上启动带有附加配置文件的 jvm:
java -Xverify:none -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf TestClass
我收到以下错误:
Error occurred during initialization of VM
agent library failed to init: JPIBootLoader
CGProf: command not found
在 Windows 上,上述命令成功运行,并且我从类的主方法中收到消息。
Linux 详细信息
uname -a
Linux michael 3.8.0-19-generic#29-Ubuntu SMP 4 月 17 日星期三 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
LD_LIBRARY_PATH
=/home/michael/eclipse/tptp/agntctrl.all_platforms-TPTP-4.7.2/linux_em64t/lib/:/home/michael/eclipse/tptp/linux.gtk.x86 -TPTP-4.7.2/plugins/org.eclipse.tptp.platform.jvmti.runtime_4.6.3.v201102041710/agent_files/linux_em64t/
TPTP_AC_HOME
=/home/michael/eclipse/tptp/agntctrl.all_platforms-TPTP-4.7.2/linux_em64t
最佳答案
分号引起了问题。在 Linux 中 ;
是同一行上两个单独命令之间的分隔符。它没有将事物解释为单个命令,而是认为它是两个命令
java -Xverify:none -agentlib:JPIBootLoader=JPIAgent:server=enabled;
和
CGProf TestClass
两者都失败了。尝试使用双引号,这将防止 shell 将其拆分
java -Xverify:none -agentlib:"JPIBootLoader=JPIAgent:server=enabled;CGProf" TestClass
您可能需要尝试放置引号的最佳位置。
关于java - 无法使用附加的探查器运行 jvm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22561333/