Two Laptop Bag*
The moose likes IDEs, Version Control and other tools and the fly likes JAVA Command Line jar file - Debug in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "JAVA Command Line jar file - Debug in Eclipse" Watch "JAVA Command Line jar file - Debug in Eclipse" New topic
Author

JAVA Command Line jar file - Debug in Eclipse

Marie O' Driscoll
Greenhorn

Joined: Mar 19, 2010
Posts: 11
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

Joined: Sep 29, 2008
Posts: 12617

In the run configuration dialog there's a text input to specify command line options.
Marie O' Driscoll
Greenhorn

Joined: Mar 19, 2010
Posts: 11
Thanks for the reply - found it and the program is working perfectly now.

thanks again
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JAVA Command Line jar file - Debug in Eclipse
 
Similar Threads
how to define a path to save a log file in log4j
createProcess error=193, %1 is not a valid win 32 application
Why doesn't Ant terminate?
Problem in linking files
I want to import single-spaced code