Saurabh Saha
Saurabh Saha

Reputation: 1153

How to add JAVA command line arguments in Eclipse Debug

I am running the main function of class by running from command line the following:

java -classpath '/Library/apache-tomcat-7.0.62/lib/*:project/webapp/b2c/ROOT/WEB-INF/lib/*' -Xmx3072m  -Xdebug com.myClass

I want to debug this class myClass.

But I cannnot do this while running from command line.

How can I debug myClass from eclipse using the same java -classpath variable

Upvotes: 0

Views: 3380

Answers (2)

SachinSarawgi
SachinSarawgi

Reputation: 2692

Right Click the class file -> Select "Debug As" -> Select "Arguments" Tab (provide the arguments)->Select "Apply" ->Select "Debug".

Right Click the class file -> Select "Debug As" -> Select "Classpath" Tab "Select BootStrap Entries"-> Add JARs "Provide jar file location"-> "Apply" ->Select "Debug".

Hope it helps.

Upvotes: 1

DamCx
DamCx

Reputation: 1047

When you try to run your class, you can edit the "Run Configurations..." and/or "Debug Configuration...", and you will have an argument tab in which you can set up the classpath

Upvotes: 0

Related Questions