I am trying to get a path to a Resource but I have had no luck.
This works (both in IDE and with the JAR) but this way I can\'t get a path to a file, only the file
You need to understand the path within the jar file.
Simply refer to it relative. So if you have a file (myfile.txt), located in foo.jar under the \src\main\resources
directory (maven style). You would refer to it like:
src/main/resources/myfile.txt
If you dump your jar using jar -tvf myjar.jar
you will see the output and the relative path within the jar file, and use the FORWARD SLASHES.