简体   繁体   中英

how to pass list of arguments to VM command line

I want to pass 2 dynamic VM argument, how?

to pass one dynamic argument i use:

 java -Dxxxxxxxx=xxxx main

but how to pass more than 1 argument.

Thanks.

From Java :

-Dproperty=value

  • Sets a system property value.
  • If value is a string that contains spaces, then you must enclose the string in double quotation marks :

java -Dmydir="some string" SomeClass

In your command line:

java -cp . -Djava.security.auth.login.config=./loginmodules.properties -Djava.security.policy=. chp02.policy -Djava.security.manager chp02.Chp02Main

the second argument -Djava.security.policy=. chp02.policy -Djava.security.policy=. chp02.policy contains a space .

You need to enclose with " or correct the argument if the space is a mistake.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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