Lewis Florez R
Lewis Florez R

Reputation: 361

Issue run spring boot profiles jar

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

Answers (3)

user1761818
user1761818

Reputation: 375

Your command is not correct it must be: java -jar [name].jar --spring.profiles.active=dev

Upvotes: 1

Lewis Florez R
Lewis Florez R

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

Bastian Klein
Bastian Klein

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

Related Questions