如何在 IntelliJ IDEA 中设置 JVM 参数? [英] How to set JVM arguments in IntelliJ IDEA?
问题描述
我对使用 Kinesis Video Stream 时的说明感到困惑
I am confused about the instruction when using Kinesis Video Stream
在 ./src/main/demo 中运行 DemoAppMain.java 并将 JVM 参数设置为
Run DemoAppMain.java in ./src/main/demo with JVM arguments set to
-Daws.accessKeyId={YourAwsAccessKey} -Daws.secretKey={YourAwsSecretKey} -Djava.library.path={NativeLibraryPath}
用于非临时 AWS 凭证.
for non-temporary AWS credential.
如何在 IntelliJ IDEA 中设置这些参数?
How to set these arguments in IntelliJ IDEA?
推荐答案
Intellij 允许您在运行 Java 程序时指定两种类型的参数:
Intellij allows you to specify two types of arguments when running a Java program:
- 虚拟机选项
- 使您能够修改 JVM 的属性,包括堆栈/堆内存分配、系统属性、GC 标志等.
- 此处输入的值会在程序开始时传递到主方法的
String[]
参数中.
在上图中,我们指定了一个名为
example
的系统属性(在 VM Options 下),其值为Hello World!
.In the above image, we specify a single system property (under VM Options) named
example
that has a value ofHello World!
.我们还指定了两个程序参数(在程序参数下):
Hello
和World!
.We also specify two program arguments (under Program Arguments):
Hello
andWorld!
.点击
Apply
按钮或OK
按钮后,我们可以运行以下程序:After clicking either the
Apply
button or theOK
button, we can run the following program:public static void main(String[] args) { System.out.println(System.getProperty("example")); System.out.println(args[0] + " " + args[1]); }
这个程序的输出如下:
Hello World! Hello World!
要创建运行/调试配置,请参阅:创建和编辑运行/调试配置
To create a Run/Debug Configuration, see: Create and Edit Run/Debug Configurations
这篇关于如何在 IntelliJ IDEA 中设置 JVM 参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!