no main manifest attribute Java Origin: Application & API OSI layer 7 · Application Last updated 2 Dec 2026

no main manifest attribute, in app.jar

The JAR has no Main-Class entry in its manifest, so java -jar does not know where to start.

Exact message you may see no main manifest attributeno main manifest attribute, inMain-Class missing manifest
Seen on: Java Maven

Meaning

A plain library JAR, a Maven build without the packaging plugin configured, or a Spring Boot app built without the repackage step does not declare a main class.

Common causes

  • Main-Class missing from META-INF/MANIFEST.MF
  • Spring Boot repackaging not run (plain jar used instead of the boot jar)
  • Wrong JAR picked from target/ (*.jar.original)
  • Maven jar plugin without mainClass

⚡ Quick fix

  1. Add Main-Class in the manifest via maven-jar-plugin / shadow / Spring Boot plugin
  2. Run the repackaged JAR, not *.original
  3. Check with jar xf app.jar META-INF/MANIFEST.MF

Detailed fix by platform

Maven

  1. Add spring-boot-maven-plugin with the repackage goal, or <archive><manifest><mainClass>com.app.Main</mainClass></manifest></archive>

Shell

  1. unzip -p app.jar META-INF/MANIFEST.MF

How to diagnose

  1. Manifest — Main-Class present?
  2. File — Right JAR?
  3. Plugin — Packaging configured?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.