Can't Execute Jar- File: "No Main Manifest Attribute"

Failing to run jar file from command line: “no main manifest attribute”

Try to run

java -cp ScrumTimeCaptureMaintenence.jar Main

Java jar file no main manifest attribute

jar cfe Hello.jar Hello Hello.class Hello.java

will do it for you. You need to point the -e parameter to the main class so that jar knows how to make it executable. This is easier than making your own manifest

SpringBoot no main manifest attribute (maven)

Try adding repackage goal to execution goals.

Otherwise you would need to call the plugin explicitly as mvn package spring-boot:repackage.

With the goal added, you have to call only mvn package.

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.places.Main</mainClass>
</configuration>

<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>


Related Topics



Leave a reply



Submit