Reputation: 361
I'm runing spring boot jar in a console
java -jar -Dspring.profiles.active=dev [name].jar
I don't understand why I get this error:
Unable to access jarfile .profiles.active=
Upvotes: 7
Views: 7341
Reputation: 375
Your command is not correct it must be: java -jar [name].jar --spring.profiles.active=dev
Upvotes: 1
Reputation: 361
For powershell, I found a solution, I put a double quote ("") "-Dspring.profiles.active=dev"
and worked well. So the full command should be like below-
java -jar "-Dspring.profiles.active=dev" [name].jar
Upvotes: 12
Reputation: 126
EDITED
The line shown in the question should work. I have tried it in an own demo project: java -jar -Dspring.profiles.active=dev build/libs/demo-0.0.1-SNAPSHOT.jar
So I assume @Indra Basak comment points into the correct direction. It looks as though the path to your jarfile is not correct.
Upvotes: 1