java 如何在intellij idea VM Options中设置javaagent?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45115208/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 08:30:52  来源:igfitidea点击:

How to set javaagent in intellij idea VM Options?

javaintellij-ideafilepathstackify

提问by hybrid

I am using Intellij Idea for development. I want to add log monitoring using

我正在使用 Intellij Idea 进行开发。我想使用添加日志监控

https://stackify.com/prefix/

https://stackify.com/prefix/

and I am following their guide on setting javaagent from the below link

我正在按照他们关于从以下链接设置 javaagent 的指南进行操作

http://support.stackify.com/hc/en-us/articles/211497443-How-to-Enable-Java-Profiling-with-Prefix

http://support.stackify.com/hc/en-us/articles/211497443-How-to-Enable-Java-Profiling-with-Prefix

intellij vm options

智能虚拟机选项

When I run the project , I am getting the following error

当我运行项目时,出现以下错误

javaagent error

java代理错误

IIntellij is reading the path till the first space only.

IIntellij 正在读取直到第一个空格的路径。

Kindly help me solve the issue. Thanks

请帮我解决问题。谢谢

回答by bowmore

You should put the file path in double quotes :

您应该将文件路径放在双引号中:

-javaagent:"C:\Program Files (x86)\StackifyPrefix\java\lib\stackify-java-sprn.jar"

回答by SteveVg

Double quotes method explained by bowmore didn't work for me, had to go the slash way:

bowmore 解释的双引号方法对我不起作用,不得不采用斜线方式:

-javaagent:C:/Program Files (x86)/StackifyPrefix/java/lib/stackify-java-sprn.jar