I have a class, JCalculator.class within com.ppowell.applications that works beautifully within NetBeans by accessing 2 important CSV files found within com.ppowell.applications.data - again, in NetBeans, absolutely no problem whatsoever finding them, accessing them and handling the data.
I then jarred the whole thing up into a Jar file, GUI.jar.
I also have a .properties file that helps in identifying the location of the CSV file by providing the dynamic source path:
com.ppowell.applications.Globals.JCalculatorGlobals.SRC_PATH = C:\\Program Files\\Java\\jdk1.6.0\\classes
Again, all of this in NetBeans is fantastic, works like a charm.
However, the goal is to create a fully-portable JAR file you can install almost anywhere and whose values are fully handled by the .properties file.
So when I installed GUI.jar onto my home computer, placed the .properties files in the correct location to be accessible, and made sure GUI.jar and all dependent .jar files were within the CLASSPATH, the moment I did this:
java -cp Tools.jar;GUI.jar com.ppowell.applications.JCalculator
The line that reads the CSV file throws a FileNotFoundException:
java.io.FileNotFoundException: File C:\Program Files\Java\jdk1.6.0\classes\\com\
ppowell\applications\data\jcalculatorbuttonkeycodes.csv does not exist.
However, opening up GUI.jar the CSV file does indeed exist, but in C:\Program Files\Java\jdk1.6.0\classes\com\ppowell\applications\data\jcalculatorbuttonkeycodes.csv
[notice the slight path change?]
The only way I can get JCalculator.class to work is to blow apart the JAR file, which I absolutely do not want to do if I want this to be fully portable and manageable by anyone who doesn't know Java out there.
Bottom line is this: How can I make sure the .properties file and the code work together to fully function whether a .jar file or separate classes?
Phil