nllsdfx
nllsdfx

Reputation: 940

Intellij IDEA: Pass java command arguments

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.

Upvotes: 1

Views: 4171

Answers (2)

ᴘᴀɴᴀʏɪᴏᴛɪs
ᴘᴀɴᴀʏɪᴏᴛɪs

Reputation: 7519

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

enter image description here

Upvotes: 4

pschichtel
pschichtel

Reputation: 779

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

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

Upvotes: 4

Related Questions