Java program with argument files - how? [message #1697154] |
Mon, 01 June 2015 22:25  |
Eclipse User |
|
|
|
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 #1697295 is a reply to message #1697269] |
Tue, 02 June 2015 22:19  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.10496 seconds