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?
Run a Nonexecutable JAR with Arguments To run an application in a nonexecutable JAR file, we have to use -cp option instead of -jar. We'll use the -cp option (short for classpath) to specify the JAR file that contains the class file we want to execute: java -cp jar-file-name main-class-name [args …]
You can change the parameters passed to the JVM in the Arguments tab in the VM Arguments box. That configuration can then be used as the default when running the project.
Do it like:
java -Xms256m -Xmx512m -Djava.awt.headless=true -jar filename.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With