1

I need to pass arguments after java but before class name at application startup in IDEA.

In "edit configuration" section "program arguments" adds options after class name.

I need this because of some features like --add-modules for java 9+. For example I want to make IDEA runs this*:

java --add-modules java.xml.ws com.pany.MainKt

But for now it does this:

java com.pany.MainKt --add-modules java.xml.ws

*All other arguments generated by IDEA are omitted for brevity.

2 Answers 2

4

JVM arguments must be added to the "VM options" field:

java <some intellij stuff> <VM options> <Main class> <Program arguments>

Sign up to request clarification or add additional context in comments.

Comments

4

You can set the VM options in the Edit configuration pane. Those will be added before the classname.

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.