Argument as txt files in eclipse-Exception in reading parameters

156 Views Asked by At

I import in java eclipse a .txt files under /src directory and I put these files as arguments into Run/run configuration/arguments tab but I still have the error:

Exception in reading parameters!
java.io.FileNotFoundException: parameters_file.txt (No such file or directory)

Also parameter files are managed like below:

int numvar = Integer.parseInt(args[4]);

What might be the problem??

1

There are 1 best solutions below

0
On

Try use this bit of code in your code:

System.out.println(System.getProperty("user.dir"));

This should show your working space, try put it there. The out put should be the main catalog of your project in work space. If even then you move it into that location, try to use full file path, this gonna help defiantly.