Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify the default JVM arguments for programs I run from eclipse?

Tags:

java

eclipse

jvm

Is there a way to specify default JVM arguments when I'm running my code from eclipse, rather than specifying the same ones over and over for each run/debug/etc configuration?

like image 501
Thomas Johnson Avatar asked May 17 '12 16:05

Thomas Johnson


People also ask

How do I change the default JVM argument?

Yes, right click the project. Click Run as then Run Configurations . 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.

Where can I find JVM arguments?

Java™ virtual machine (JVM) arguments are defined in the startup command script (Oracle WebLogic) or Admin Console (IBM® WebSphere®) for your web application server.


1 Answers

Go to Window → Preferences → Java → Installed JREs. Select the JRE you're using, click Edit, and there will be a line for Default VM Arguments which will apply to every execution. For instance, I use this on OS X to hide the icon from the dock, increase max memory and turn on assertions:

-Xmx512m -ea -Djava.awt.headless=true 
like image 147
Alice Young Avatar answered Sep 22 '22 05:09

Alice Young