Dominic Bou-Samra Dominic Bou-Samra - 4 months ago 13
Java Question

Specifying JVM arguments when calling a jar file?

I want to specify some JVM arguments when calling a jar file like so:

java -jar filename.jar


I assumed I did it like so:

java -Xms256m -Xmx512m -Djava.awt.headless=true jar filename.jar


But this doesn't seem to work. What am I doing wrong?

Answer

Do it like:

java -Xms256m -Xmx512m -Djava.awt.headless=true -jar filename.jar
Comments