How to include text files with Executable Jar
you want it IN the executable jar? then to read the file you should use
getClass().getResourceAsStream()
to read the file.
Keep the text file in the package you want to access it from. The classloader will find it.
Remember also that filenames in JARs are case sensitive.
The base directory in the jar file is in the classpath.
Try InputFlatFile currentFile = new InputFlatFile("theFile.txt");
You are probably using an IDE and it has a src folder in it that the IDE uses for the base of the packages. When you create the jar file from the IDE it then removes the src folder and the root folder has the packages in it.
i.e. in eclipse src/com.blah.blah once jar file is created the structure becomes com.blah.blah
Of course I assume that InputFlatFile is properly reading the value.
http://www.devdaily.com/blog/post/java/read-text-file-from-jar-file