How to set javaagent in intellij idea VM Options?
Asked Answered
P

2

14

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

https://stackify.com/prefix/

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

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

IIntellij is reading the path till the first space only.

Kindly help me solve the issue. Thanks

Paginal answered 15/7, 2017 at 6:25 Comment(5)
Have you tried escaping the spaces?Therontheropod
@Therontheropod no I havent. Which escape character is acceped for vm options for space?Paginal
I'm on Linux so I wouldn't entirely know for Windows, but I've used backslash. You may want to reference how to escape spaces in Windows paths, though.Therontheropod
@Therontheropod tried backslash and ^ . Still reading till first spacePaginal
"c:\Program Files (x86)\Stackify..." ?Tasker
L
31

You should put the file path in double quotes :

-javaagent:"C:\Program Files (x86)\StackifyPrefix\java\lib\stackify-java-sprn.jar"
Lightweight answered 15/7, 2017 at 6:42 Comment(1)
How to use it from a dynamic path? i.e %AppData%Aliaalias
V
10

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

-javaagent:C:/Program Files (x86)/StackifyPrefix/java/lib/stackify-java-sprn.jar
Vermicular answered 20/8, 2018 at 8:30 Comment(3)
How about on LinuxEphesus
Try escaping spaces with backslashesVermicular
How to use it from a dynamic path? i.e %AppData%Aliaalias

© 2022 - 2024 — McMap. All rights reserved.