To retrieve the file inside the jar, use:
private static final String ENDINGS_FILE_NAME = "/res/endingRule.txt";
...
InputStream is = getClass( ).getResourceAsStream(ENDINGS_FILE_NAME);
More Related Contents:
- Reading a resource file from within jar
- How do I read a resource file from a Java jar file?
- Load a resource contained in a jar
- How to access resources in JAR file?
- Add image to JAR Java
- Classpath resource within jar
- play .wav file from jar as resource using java
- Accessing JAR resources
- How to package resources in Jar properly
- Accessing a file inside a .jar file [duplicate]
- Loading a file relative to the executing jar file
- Loading ImageIcon from JAR or file system
- Read directory inside JAR with InputStreamReader
- How to make an executable JAR file?
- What is a fat JAR? [duplicate]
- Call “java -jar MyFile.jar” with additional classpath option
- getResourceAsStream returns null
- Controlling Maven final name of jar artifact
- How to write a Java program which can extract a JAR file and store its data in specified directory (location)?
- How can I access a folder inside of a resource folder from inside my jar File?
- Proper way to close an AutoCloseable
- Eclipse: Attach source/javadoc to a library via a local property
- Multiple runnable classes inside JAR, how to run them?
- What is the best way to avoid maven-jar?
- How to include local jar files in Maven project [duplicate]
- Adding 3rd party jars to WEB-INF/lib automatically using Eclipse/Tomcat
- How to read text file from classpath in Java?
- Java – Loading dlls by a relative path and hide them inside a jar
- How do I compile a java file that has jar dependencies?
- Where should i place my files in order to be able to access them when i run the jar?