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 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-Classmissing 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
- Add
Main-Classin the manifest via maven-jar-plugin / shadow / Spring Boot plugin - Run the repackaged JAR, not
*.original - Check with
jar xf app.jar META-INF/MANIFEST.MF
Detailed fix by platform
Maven
- Add
spring-boot-maven-pluginwith therepackagegoal, or<archive><manifest><mainClass>com.app.Main</mainClass></manifest></archive>
Shell
unzip -p app.jar META-INF/MANIFEST.MF
How to diagnose
- Manifest — Main-Class present?
- File — Right JAR?
- 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:
Most viewed in Java
Other ways to find it
🧠 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.
Did this fix work for you?
Report a correction or suggest an improvement
Last updated 2 Dec 2026