I have created an executable Jar and want to include and read data from within the jar file for the application to use. Each time I run the application it does not find the data files. Any help to have a Jar application read a file within its own Jar would be appreciated.
I have tried the following and both did not work.
--------------------------------------------
try{
String soilline = null;
BufferedReader brsoils =
new BufferedReader( new FileReader(new File ("C:\\Program Files\\Calc\\Calc_DATA\\test.dat" )));
......
---------------------------------------------
try{
String soilline = null;
BufferedReader brsoils =
new FileReader(new File (System.getProperty("user.dir") + "\\test.dat" )));
.....
---------------------------------------------------
Thanks Ronnie
I have tried the following and both did not work.
--------------------------------------------
try{
String soilline = null;
BufferedReader brsoils =
new BufferedReader( new FileReader(new File ("C:\\Program Files\\Calc\\Calc_DATA\\test.dat" )));
......
---------------------------------------------
try{
String soilline = null;
BufferedReader brsoils =
new FileReader(new File (System.getProperty("user.dir") + "\\test.dat" )));
.....
---------------------------------------------------
Thanks Ronnie