How to pass Properties to jar from Powershell?

Take a look at my answer to this question. Note how you can use echoargs.exe to diagnose these sort of problems. Most likely the fix would be to quote the parameter e.g.:

java -jar "-Duser.language=en" any.jar

You can test that using echoargs (from PowerShell Community Extensions):

echoargs -jar "-Duser.language=en" any.jar
Arg 0 is <-jar>
Arg 1 is <-Duser.language=en>
Arg 2 is <any.jar>

Leave a Comment