5

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
  • 497
  • 3
  • 10
kloop
  • 3,979
  • 11
  • 39
  • 58

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,605
  • 7
  • 41
  • 55
1

Run --> Run Configurations --> Arguments

BVSmallman
  • 591
  • 2
  • 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
  • 335,521
  • 76
  • 467
  • 706