Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am confused about the instruction when using Kinesis Video Stream

Run DemoAppMain.java in ./src/main/demo with JVM arguments set to

-Daws.accessKeyId={YourAwsAccessKey} -Daws.secretKey={YourAwsSecretKey} -Djava.library.path={NativeLibraryPath}

for non-temporary AWS credential.

How to set these arguments in IntelliJ IDEA?

I followed the documentation and found the "Run/Debug Configurations" and don't know what to do next.

Any help?
Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
145 views
Welcome To Ask or Share your Answers For Others

1 Answer

Intellij allows you to specify two types of arguments when running a Java program:

  • VM Options
    • Enables you to modify attributes of the JVM, including stack/heap memory allocation, system properties, GC flags, etc.
  • Program Arguments
    • Values entered here are passed into the String[] parameter of your main method when the program begins.

enter image description here

In the above image, we specify a single system property (under VM Options) named example that has a value of Hello World!.

We also specify two program arguments (under Program Arguments): Hello and World!.

After clicking either the Apply button or the OK 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]);
}

The output of this program is as follows:

Hello World!
Hello World!

To create a Run/Debug Configuration, see: Create and Edit Run/Debug Configurations


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...