Search code examples
javaspringmavenspring-boot-admin

Run Java spring application


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)


Solution

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

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