I have an application that works correctly when used in this form
java myApp. it is able to real the files listed in a sub directory with this structure
myApp.class
filedir/filetoread.txt
however when I jar these with the following
jar -cf myApp.jar *
jar umf ../manifest.txt myApp.jar
maifest.txt has the following information
Class-Path: myApp.jar filedir/
Main-Class: myApp
when I run the app with
java -jar myApp
the applicationn runs but cannot find the filetoread.txt file.
----> here is my read file method
private
String readFile(String filename) {
String nextLine = "";
StringBuffer sb = new StringBuffer();
java.io.File f = new java.io.File(filename);
try {
String lineSep = System.getProperty("line.separator");
java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader(f));
while ((nextLine = br.readLine()) != null) {
sb.append(nextLine);
//
// note:
// BufferedReader strips the EOL character.
//
sb.append(lineSep);
}
}
catch(Exception e) {
e.printStackTrace();
}
return sb.toString();
}
}
any assistance would be fantastic
regards
Kyle