“Failed to load Main-Class manifest attribute …”,
Everything needed to run a jar file has been set, e.g. classpath, manifest file, etc. Yet after multiple checking and rechecking, you still unable to get the jar file run and, as a result, you get even more frustrated.
Take a look at the error message. What it says is that java.exe could not find the main class of our java application. The main class itself, as the entry point of a java application, is specified in file MANIFEST.MF.
So, you have to make sure that the main class is actually specified in the manifest file, i.e. the following line is available somewhere in your manifest file:
Main-Class: MyMainClass
Oh… in case you don’t notice… MyMainClass is actually your main class name, so replace it with the full name of your main class (the name of the class along with its package, if any)
There is one more fact you need to know about manifest file. You need to put a line break after the last line of the file. Fail to do so, the last line of the file won’t be parsed properly. So, in accordance with that, don’t forget to insert a line break to the line where the main class is specified, otherwise the error message will still pop up.
8 comments:
Assalamualaikum..Hai Cut Bang, Trep that hana merumpok, Peu haba lawetnyo...
Ne halo keuno ilee, jeut tapegah haba : 0812 6999 175, Loen hana no. droen...
Saleum
M. Arif Syahrijal
Thank's for the very usefully information (intelligible to non-experts like me).
Thanks dude your easy solution to the problem with manifest file just saved my life! May God Bless U!
Here is another way to fix failed to main class manifest attribute from JAR in Eclipse
This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb. This trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolites festivity to pity. I appreciated what you ok extremely here
Data Science Course in Indira nagar
Data Science Course in btm layout
Python course in Kalyan nagar
Data Science course in Indira nagar
Data Science Course in Marathahalli
Data Science Course in BTM Layout
Data science course in bangalore
Every concept should be neatly represented. concepts are explained very neatly.
Data Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb. This trumpet is a famous tone to nab to troths.
oracle training in chennai
oracle training in omr
oracle dba training in chennai
oracle dba training in omr
ccna training in chennai
ccna training in omr
seo training in chennai
seo training in omr
Post a Comment