You should use getResourceAsStream()
instead. If the file is embedded in your JAR the URI is most likely bundle:// URI
InputStream is = this.getClass().getResourceAsStream("my.conf");
More Related Contents:
- How to make an executable JAR file?
- How do I read a resource file from a Java jar file?
- What is a fat JAR? [duplicate]
- Call “java -jar MyFile.jar” with additional classpath option
- Controlling Maven final name of jar artifact
- How to use classes from .jar files?
- How to write a Java program which can extract a JAR file and store its data in specified directory (location)?
- What is the maven-shade-plugin used for, and why would you want to relocate Java packages?
- Java creating .jar file
- How to use .jar files in NetBeans?
- How do I read the manifest file for a webapp running in apache tomcat?
- Eclipse: Attach source/javadoc to a library via a local property
- Modifying a file inside a jar
- Multiple runnable classes inside JAR, how to run them?
- Run exe which is packaged inside jar file
- Including Images with an executable jar
- What version of javac built my jar?
- What is the best way to avoid maven-jar?
- Can I set Java max heap size for running from a jar file?
- Including jar files in class path
- play .wav file from jar as resource using java
- How to include local jar files in Maven project [duplicate]
- Replacement System Classloader for Classes In Jars containing Jars
- Accessing JAR resources
- Adding 3rd party jars to WEB-INF/lib automatically using Eclipse/Tomcat
- Accessing a file inside a .jar file [duplicate]
- Java – Loading dlls by a relative path and hide them inside a jar
- How do I compile a java file that has jar dependencies?
- Convert .Jar to .Dmg
- How to create my own java library(API)?