How to pass system properties to a jar file

前端 未结 2 1543
不思量自难忘°
不思量自难忘° 2020-12-08 02:11

I have a main class that expects certain properties that I pass using the -D option. I can access this in my IDE by sending them as VM options.

I package this applic

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 02:28

    Adding to Elliott's answer, if I just run this then I get an error:

    java -Djna.nosys=true -jar jenkins.war
    

    but if I add quotes like this then it works:

    java "-Djna.nosys=true" -jar jenkins.war
    

提交回复
热议问题