How to view command line string used by Intellij to invoke Java process?
Answered
Is there any way to view the complete command line string used by IntelliJ when we click on Run button? The same feature is available in eclipse when you open debug perspective and view properties of the process.
Please sign in to leave a comment.
IDEA is not running java binary, so there is no way to see the commands. Instead, IDEA uses Java compiler API directly. If you want a raw representation of what is done to build the project, you can use Build | Generate Ant build. Examine the build file or run it from the command line via Ant to see what happens and what options/commands are invoked.
Hi Petr,
Thanks for the response. I suppose IntelliJ must be using java or javaw.exe process on shell to start the JVM process. I wanted to know the same command line string it uses to invoke the Java process and not the build command like following:
e.g java -Dproperty1=value1 -Dproperty2=value2 com.package.hello arg1 arg2
This line is shown in a Run console window, on top.
https://www.jetbrains.com/help/idea/run-tool-window.html
Yes that is working. Thank you! I have a small question, I ran the same command line through console, but it didn't run my application due to some path issues. Is IntelliJ doing something behind the scenes as javaagent?
Are you sure you have copied the whole line, with all classpath? Could you please provide the error message?
Is there any way to view the command line that will be generated before Intellij tries to run it? I'm having an issue on windows where my command line is too long and I would like to preview it so I can see what the culprits are. I've tried using the command line shortening built in into Intellij, but that gives other errors in the project I'm working with.
@Sebastian Stoelen lest use another thread that you have created for discussion: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006865439-Preview-command-line-that-is-genereated-by-Intellij