-1

I would like run in shell spring-boot-admin-sample application: https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample/

But when I compile and run application by commands:

mvn package 
java -cp target/spring-boot-admin-sample.jar de.codecentric.boot.admin.SpringBootAdminApplication

I get Error: Could not find or load main class de.codecentric.boot.admin.SpringBootAdminApplication

What I have to do for right run??

(I am beginner in Spring and Java)

mjablecnik
  • 182
  • 1
  • 14

2 Answers2

4

it's an executable jar, so you run it with:

java -jar target/spring-boot-admin-sample.jar
anders
  • 814
  • 7
  • 12
1

If you want to run it in the background, so that it doesn't exit when you close your terminal etc. try:

java -jar target/spring-boot-admin-sample.jar &

I usually do this when I'm testing some POC SpringBoot apps locally.

HomerPlata
  • 1,687
  • 5
  • 22
  • 39