In a java project I have been given, at one point an external file is referenced. This file is held in a folder named resources
. In the code, the call is:
DHKeyReader d = new DHKeyReader("resources/filename")
When run in Eclipse (3.7.2) this executes without failure. However, when exported to a jar, this fails with an IOException.
I am hesitant to modify the code, as it was given to me under the pretense that it worked and I was to familiarize myself with it so it could be altered. However, there still could be errors.
My question is this: how do I make a folder (held on the root of the .jar) visible within the jar like it is when running in Eclipse?