我无法通过以下命令在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上,上述命令成功运行,我从类的main方法中获得消息。
linux详细信息
uname -a LinuxMichael3.8.0-19-泛型#29-Ubuntu 4月17日18:16:28 UTC 2013 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
发布于 2014-03-21 14:37:20
分号引起了问题。在linux中,;是同一行中两个单独命令之间的分隔符。与其将事物解释为一个单一的命令,它还认为它的两个命令
java -Xverify:none -agentlib:JPIBootLoader=JPIAgent:server=enabled;和
CGProf TestClass两人都失败了。尝试使用双引号,这将防止shell拆分它。
java -Xverify:none -agentlib:"JPIBootLoader=JPIAgent:server=enabled;CGProf" TestClass你可能需要尝试最好的地方来放置引号。
https://stackoverflow.com/questions/22561333
复制相似问题