Hi, I've seen this in a couple of post but can't get it to work
My problem is I got a .properties file which is read and written by a .jar app. When I run the project from eclipse I ge the file like this:
But the standard we work here says IF we use a .properties it should be in a /conf folder. so I change that line to this, everytime I require to build it with ant
Turns out that on Linux the "../" is nto working and I already trie all the combinations with // \\\ and anything
I would like in order to avoid the changes and the problems with relative paths, by including the .properties file inside the jar, something like keeping ti next to the src folder on eclipse and that when I build the Ant target it stays at the initial level inside the jar, How?
When working with JAR files, you can't make any assumptions on what the current directory is, and therefore what relative files will be. Your resources should:
a) be specified using absolute paths, or
b) be put inside the JAR file so you can use Class.getResource(AsStream) or ClassLoader.getResource(AsStream), or
c) be put on the class path, so you can use ClassLoader.getResource(AsStream).