This is mind-boggling... I can make getResource() and getResourceAsStream() work properly when I run Java on my packaged JAR file that includes a text file. (for reference s
I have a hunch it has to do with CLASSPATH and/or where Eclipse puts the .class files it autocompiles.
In the Run Configuration for however you are launching your application, go to the Classpath tab and add the root folder of the path that you are using to access the file.
So for example if you are trying to load "blah/file.txt" and the file resides in "folder/blah/file.txt", add "folder" to the classpath. If you are trying to load the resource with just "file.txt", then add "folder/blah".