JAVA FileNotFoundException error when running jar file --spring.config.location

Viewed 55

I am trying to run jar file with an external json config file with this

java -jar application.jar --spring.config.location=file:///Users/configuration/config.json

and I got errors as

FileNotFoundException: --spring.config.location=file:/Users/configuration/config.json (No such file or directory)

I'm pretty sure the path is correct.

I could run the java program without error with

mvn exec:java -Dexec.mainClass="package.main"  -Dexec.args="/Users/configuration/config.json"

Anyone knows how to run with jar file? Thanks a lot !!

0 Answers
Related