Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Java program with argument files - how?(Argument files 'not found' when running .java program)
Java program with argument files - how? [message #1697154] Tue, 02 June 2015 02:25 Go to next message
Diana Popova is currently offline Diana PopovaFriend
Messages: 7
Registered: June 2015
Junior Member
New to Eclipse, just installed on my Mac Yosemite.
Eclipse does not see the argument files:
Exception in thread "main" java.io.FileNotFoundException: edges01.txt (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at java.io.FileReader.<init>(FileReader.java:58)
at KCoreInfluential.<init>(KCoreInfluential.java:33)
at KCoreInfluential.main(KCoreInfluential.java:323)
There is another argument file as well.
I put both files into the same project with the Java program - 'no such file';
then I tried to put them into Path (Build Path) - still the above error message.
Please, help - how to make Eclipse to see the argument files?
Re: Java program with argument files - how? [message #1697239 is a reply to message #1697154] Tue, 02 June 2015 15:47 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
What code are you using to load the files?
Re: Java program with argument files - how? [message #1697244 is a reply to message #1697239] Tue, 02 June 2015 16:15 Go to previous messageGo to next message
Diana Popova is currently offline Diana PopovaFriend
Messages: 7
Registered: June 2015
Junior Member
Import... General/FileSystem, while in the src/Default Package.
Re: Java program with argument files - how? [message #1697269 is a reply to message #1697244] Tue, 02 June 2015 20:23 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
I mean, show us the code you're using that tries to load the files but produces FileNotFoundException.
Re: Java program with argument files - how? [message #1697295 is a reply to message #1697269] Wed, 03 June 2015 02:19 Go to previous message
Diana Popova is currently offline Diana PopovaFriend
Messages: 7
Registered: June 2015
Junior Member
I just try to run in Eclipse the same program that I run using Mac Terminal. So, in the main there are argument files:
KCoreInfluential kc = new KCoreInfluential("edges01.txt", "nodeweights01.txt");

And in the class there is a call:

//Reading edges
BufferedReader reader = new BufferedReader( new FileReader (edgesfilename));

If I put the program and the argument files in the same folder/directory, it compiles just fine (Terminal command 'javac') and then runs fine.
I thought Eclipse will do the same, and if the argument files are in the same project with the java code, it will see them. Apparently, not.

Please, advise, how to make Eclipse to see the argument files.
Previous Topic:Exception while starting [Agent Controller] ACServer
Next Topic:Highlight and color text?
Goto Forum:
  


Current Time: Tue Apr 16 18:46:46 GMT 2024

Powered by FUDForum. Page generated in 1.92071 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top