I\'ve been using Powershell-1.0 for command line needs for a while, instead of cmd.exe. Unfortunately, there are still some caveats when using Java. I need to pass a propert
Try launching instead using the following pattern:
java -Duser.language=en -jar any.jar
That assumes that user.language is meant as a system property. If you meant it as a command line argument, change that to:
java -jar any.jar -Duser.language=en
I am actually surprised that the command line you mentioned works at all outside of powershell (though I have confirmed that it works fine for me too, even on Linux) and it is also a little strange that things would work differently inside and outside of powershell.
From java -help
:
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
...
-D=
set a system property
...
So basically you should always put the JAR filename directly after the -jar
command line option, and any JVM options (such as setting system properties with -D
) before.