spring-attic / gs-gradle

Building Java Projects with Gradle :: Learn how to build a Java project with Gradle.

Home Page:http://spring.io/guides/gs/gradle/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why couldn't I use java -jar build/lib/gs-gradle-0.1.0.jar for results in terminal?

cnzj opened this issue · comments

commented

I'm a newbie for gradle in spring.
Could you help me?

commented

When I user java -jar for testing. I get this:

~/workspaces/spring/gs-gradle> java -jar build/libs/gs-gradle-0.1.0.jar
Failed to load Main-Class manifest attribute from
build/libs/gs-gradle-0.1.0.jar

Now worries, this is a good place to ask questions. You can't run gs-gradle-0.1.0.jar as an executable jar because this sample is not about Spring Boot(which would create an executable jar). This sample just tries to steer user through a generic gradle build process.

You can get familiar with Boot for example using a sample https://spring.io/guides/gs/spring-boot/.

From there if you follow a guide, you'll see instructions to guide you to run command:

java -jar build/libs/gs-spring-boot-0.1.0.jar

Good luck and have fun with Boot!

@cnzj, did @jvalkeal's recommendation help?

commented

Thank you for your help, i tried the spring-boot and i'm reading the spring-boot Module Documentation.Boot is a great job, thanks!