aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes ECLIPSE -  Program Arguments - Trying to pass file names to MAIN 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 "ECLIPSE -  Program Arguments - Trying to pass file names to MAIN" Watch "ECLIPSE -  Program Arguments - Trying to pass file names to MAIN" New topic
Author

ECLIPSE - Program Arguments - Trying to pass file names to MAIN

bob connolly
Ranch Hand

Joined: Mar 10, 2004
Posts: 204
Hi there, i'm trying to pass 3 file references into a pgm via the main function in Eclipse and i'm using the run/program arguments text box, but it's not really clear how to enter in those particular references!

I tried various combinations,
ex1: <theinstrumentfile.xml> <the marginfile.xml> <the unixfile.txt>

ex2: "theinstrumentfile.xml", "the marginfile.xml", "unixfile.txt"

ex3: new RangeComparator("theinstrumentfile.xml", "themarginfile.xml", "theunixfile.txt");

In ex3, i hardcoded the file names into the function call itself!

Also, I put the actual file names and data in the project directory under those above names and the error i'm getting is:

theinstrumentfile.xml (The system cannot find the file specified) Nested exception: theinstrumentfile.xml (The system cannot find the file specified)

The first 2 files will be used by the XML SAX class and when that data is loaded, it will be applied against the unixfile.txt data!

Thanks for any clues on this !

BC
Bill Dudney
Author
Ranch Hand

Joined: Sep 05, 2003
Posts: 234
Hi Bob,

If you think of the 'program arguments' box as a piece of the command line then you will be OK. For example

java -cp $MYCP foo.bar.MyProgram theinstrumentfile.xml themarginfile.xml unixfile.txt

might be a command line that you'd use to invoke your program in the Eclipse Run Profile manager you'd place

theinstrumentfile.xml themarginfile.xml unixfile.txt

in the 'Program arguments' text field in the 'Agruments' tab in the Run Profile editor modal dialog.

If these files are in the root directory of the project you should be able to just use


Hope this helps!


TTFN,<br /> <br />-bd-<br /> <br /><a href="http://www.amazon.com/exec/obidos/ASIN/0471449156/qid=1064343733/sr=2-1/ref=sr_2_1/002-8375300-3666449" target="_blank" rel="nofollow">Jakarta Pitfalls</a> | <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0471146153/qid=1064343733/sr=1-2/ref=sr_1_2/002-8375300-3666449?v=glance&s=books" target="_blank" rel="nofollow">J2EE AntiPatterns</a> | <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0471462071/qid=1064343733/sr=1-3/ref=sr_1_3/002-8375300-3666449?v=glance&s=books" target="_blank" rel="nofollow">Mastering JavaServer Faces</a> | <a href="http://bill.dudney.net/roller/page/bill" target="_blank" rel="nofollow">Blog</a> | <a href="http://www.jroller.com/page/BillDudney" target="_blank" rel="nofollow">Eclipse Blog</a> | <a href="http://www.sourcebeat.com/TitleAction.do?id=2" target="_blank" rel="nofollow">Eclipse 3 Live</a>
bob connolly
Ranch Hand

Joined: Mar 10, 2004
Posts: 204
Thanks alot Bill, got it working thanks to your help!

Just specified the file names by themselves and then selected the local directory box and it went through!

Also Bill, if you've had the opportunity to try them out, do you prefer any particular IDE over the other, ie JDeveloper, NetBeans or Eclipse ect?

Thanks again Bill and have a wonderful day!
Bill Dudney
Author
Ranch Hand

Joined: Sep 05, 2003
Posts: 234
Hi Bob,

Well I have not used JBuilder since 2.0 way back when it first went 'all java' so I'm no expert on it. NetBeans looks really cool and it has J2EE stuff built in (JSP, XML etc) so it has lots going for it as well. When I was at InLine Software we integrated with both of these IDE's as well as Visual Cafe. If you've not looked Idea's IntelliJ is also very good, I've been using that for my 'day job' recently and I really like it as well.

Since I wrote a book about Eclipse I'm probably supposed to say you should use that but it all boils down to what you are most productive with so I'd suggest you try each for a week then go with the best feeling one.

Good Luck!
 
Don't get me started about those stupid light bulbs.
 
subject: ECLIPSE - Program Arguments - Trying to pass file names to MAIN