Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA Command Line jar file - Debug in Eclipse

 
Marie O' Driscoll
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am a C programmer so forgive me if these questions are a bit stupid.

I use a mobility simulator to generate a trace file of vehicles positions (a .txt file) via a tool called traceExporter, which I then read into a network simulator. I do this with the following commad on the command line:

JAVA -jar traceExporter.jar ns2 -n Corkcity.net.xml -t Corkcitynetstate.xml -a Corkcityactivity.tcl -m Corkcitymobility.tcl -c Corkcityconfig.tcl -p 1 -b 500 -e 630

The -n and -t fields are files that are passed in, the -a,-m and -t fields are the names of files that written out from the tool and the -p, -b and -e are necessary values that need t be passed in. My problem is that theres a bug with the traceExporter module of the mobility simulator and the files that are being output are incorrect. I need to find out where the problem is (so I need to debug the java code behind this in an IDE)

Therefore my question is this:

I have download eclipse. I have a number of java files located in the traceExporter folder including one which has a main file. Do I try to import all the files into eclipse and run it as a standard java application? How do I "pass in" the arguements that I would ordinarily pass in on the command line?

I must be doing something wrong because in Eclipse I created a new java project - I added all the files I have (one of which has a main class) and tried to run the project but am getting an error: Editor does not contain a main type

Many thanks in advance.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the run configuration dialog there's a text input to specify command line options.
 
Marie O' Driscoll
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply - found it and the program is working perfectly now.

thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic