0

I have been trying to run a fat Spring Boot Jar which has a third party library which loads a .properties from the classpath. The .properties file is not inside the jar file.

The required .properties is in a folder other than the /lib or /config or root where the fat jar is located.

I have set the CLASSPATH variable to include the external folder where the .properties file is residing.

I tried giving -cp and -classpath also when running the fat jar using java -jar command but to no avail.

I tried using --loader.path but no success.

The Exception I am getting is;

java.lang.NullPointerException: null
        at java.util.Properties$LineReader.readLine(Properties.java:434)
        at java.util.Properties.load0(Properties.java:353)
        at java.util.Properties.load(Properties.java:341)
shazin
  • 21,379
  • 3
  • 54
  • 71
  • Did you ever figure this out? I'm having the same issue: https://stackoverflow.com/questions/51735728/using-external-third-party-properties-file-with-spring-boot-fat-jar – mnd Aug 08 '18 at 13:09
  • Also, I read that when you use the `java` command with the `jar` parameter, you're not able to set the classpath: https://stackoverflow.com/a/18413058/2601060 – mnd Aug 08 '18 at 13:10

0 Answers0