Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set java_opts in eclipse

Tags:

java

eclipse

I need to set JAVA_OPTS in a development machine running windows 7 home edition and tomcat 7 server. I am getting permgen out of memory error when running spring-mvc web applications from eclipse. I want to enable class unloading so that memory gets freed up over the course of repeated reloading of web applications. I also want to increase the amount of memory available.

Can someone show me explicitly how to do this, in step by step form?

Do I set a windows system environmental variable? Do I run something from the command line? What specifically will my commands look like in code?

Here is what I have so far (all on the same line):

JAVA_OPTS=XX:MaxPermSize=128MXX:+CMSClassUnloadingEnabledXX:+CMSPermGenSweepingEnabledXms256m -Xmx512m 
like image 977
CodeMed Avatar asked Nov 27 '13 21:11

CodeMed


People also ask

How do I set VM arguments in Eclipse?

-- Go to the Eclipse Window > preferences, in "Java > Installed JREs". -- Copy the current default JRE with a new name, for example myJRE. -- Select the new JRE and click on the "Edit" button. -- In the "Edit JRE" dialog, add your JVM arguments in the "Default VM Arguments" field.

What is Java_opts environment variable?

JAVA_OPTS is an environment variable that you can set to pass custom settings to the Java Virtual Machine (JVM) that runs Liquibase.


1 Answers

In eclipse go to your launch configuration of the server (something like Apache Tomcat > Tomcat v7.0 Server at localhost) and add jvm arguments in the Arguments tab in the VM arguments field.

If you are using eclipsetotale tomcat plugin then go to

Preferences > Tomcat > JVM Settings > Append to JVM Paramaters

and add them one by one.

EDIT (run as > run on server)

enter image description here

like image 196
A4L Avatar answered Sep 28 '22 09:09

A4L