6

How can I add command line parameters to the JVM in Eclipse? For example, let's say I want to explicitly add -cp argument when running the JVM, is it possible? (I am giving it as an example, I realize I can add an external Jar to the project settings to get an additional classpath.)

The argument I want to add is -agentlib:Shark (on Mac OSx for running a profiler).

WA Hunt
  • 517
  • 4
  • 10
kloop
  • 4,537
  • 13
  • 42
  • 66

3 Answers3

17

You can specify vm arguments when creating a "Run Configuration" in Eclipse. Right-click on your project > Run Configuration > Java Application > Arguments tab.

enter image description here

enter image description here

Jim Mitchener
  • 8,835
  • 7
  • 40
  • 56
1

Run --> Run Configurations --> Arguments

BVSmallman
  • 601
  • 3
  • 9
1

In the Run menu, there is an entry "Run Configurations", which allows you to configure everything about the spawned JVM. It has a tab to set the classpath, and another called "Arguments" where you can set JVM parameters.

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720