简体   繁体   English

Intellij IDEA:传递Java命令参数

[英]Intellij IDEA: Pass java command arguments

I need to pass arguments after java but before class name at application startup in IDEA . 我需要在java之后但在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+. 我之所以需要它,是因为Java 9+的--add-modules等功能。 For example I want to make IDEA runs this*: 例如,我想让IDEA运行以下*:

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. *为简洁起见,省略了IDEA生成的所有其他参数。

You can set the VM options in the Edit configuration pane. 您可以在“ Edit configuration窗格中设置VM options Those will be added before the classname. 这些将添加在类名之前。

在此处输入图片说明

JVM参数必须添加到“ VM options”字段中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM