I am reading a *.properties file using properties.load and a file name.
I want to add the properties file to the jar or to the classpath.
Place the file in the source folder, it will be copied to the output and added to the jar together with the classes according to Settings | Compiler | Resource Patterns.
To load the file in your app use something like:
Properties props = new Properties();
InputStream is = this.getClass().getResourceAsStream("/file.properties");
props.load(is);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With