I'm using OS X, Netbeans 7.3 Beta 2, Java.
I have a program which reads from a text file. When running my distributed jar, my program does not utilise this .txt file.
Here are my two packages - ignore all java files in com.john.view apart from SPPMainGUI2.java:
As you can see, cpass.txt is found in com.john.spp. Here is how I use it:
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader("cpass.txt"));
} catch (FileNotFoundException ex) {
Logger.getLogger(SPPMainGUI2.class.getName()).log(Level.SEVERE, null, ex);
}
I'm guessing my FileReader location needs to be altered. When my program runs from Netbeans it works fine, when I run the jar file found in my dist folder, it doesn't pick up the .txt file.
Any ideas?