Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default VM Arguments in Eclipse : -javaagent

Tags:

java

eclipse

I need to set the following argument as the Default VM Arguments in Eclipse

-javaagent /Developer/aspectj-1.6/aspectjweaver.jar

When I add the line and run my code, it gives me the error:

Unrecognized option: -javaagent
Could not create the Java virtual machine.

How do I fix this ?

like image 829
Ashish Agarwal Avatar asked Jul 31 '13 23:07

Ashish Agarwal


People also ask

How do I set default 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 are VM arguments in Java Eclipse?

VM arguments are typically values that change the behaviour of the Java Virtual Machine (JVM). For example, the -Xmx256M argument allows the Java heap to grow to 256MB. The Eclipse runtime is also configurable via many system properties which can be passed as VM arguments in the form: -DpropertyName=propertyValue.

Where are the VM options in Eclipse?

Step 1: Open the IDE and right-click on the application in which you want to pass VM arguments. Step 2: Click on the Run As » Run Configurations… Step 3: Click on the Arguments tab and in the VM arguments: box, type the arguments that you want to pass.

Where are JVM parameters set?

The directory server provides a means of configuring the Java Virtual Machine (JVM) and Java options for each command-line utility and for the directory server itself. The Java configuration is provided in a properties file, located at instance-dir /OUD/config/java.


1 Answers

You need a colon (:) between the -javaagent and the JAR, not a space. For example:

-javaagent:/Developer/aspectj-1.6/aspectjweaver.jar
like image 140
Edward Thomson Avatar answered Oct 01 '22 03:10

Edward Thomson