

The following entries can be put into your build. If you need more information, dig deep into maven-jar-plugin documentation: see Specify Main-Class in Gradle You have to change this according to your specific project. To learn how to set up and run the script go to Running your First Script page. Press Apply and Ok at the bottom right of the window. In the code snippet above, is our fully-qualified name of the Main-Class. Then you need to remove client.jar dependency from being included in the artifact, you can do this by right clicking the client.jar in the list and selecting remove. This issue can be resolved by adding maven-jar-plugin to our pom.xml file. The "no main manifest attribute" error message may occur in a Maven project due to the absence of the Main-Class entry in MANIFEST.MF. Opening the jar file with WinRAR, you would see the contents of it, along with MANIFEST.MF.Ī typical MANIFEST.MF file should contain the following lines Manifest-Version: the version of the Manifest file.īuild-Jdk: the JDK version installed in your machine.īelow is an example of a MANIFEST.MF file.

Inside the jar file, the MANIFEST.MF file is located in META-INF folder. Without a Main, or Main-Class attribute, Java have no way to know which class it should run when you execute the jar. It tells Java which class would be used as the entry point of the application. The Main, or Main-Class is an essential attribute to make your jar executable.

