File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Compiling into a .jar on Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Compiling into a .jar on Eclipse" Watch "Compiling into a .jar on Eclipse" New topic

Compiling into a .jar on Eclipse

Ryan Carter-Reich

Joined: Jun 16, 2010
Posts: 3
I'm using Eclipse, and I need to compile my project into a .jar file, but every time I try to run the exported file, I get:

Failed to load Main-Class manifest attribute

I've googled it, and from what I've discerned from the results, nothing in the manifest is point to the class with my main() in it. Only problem is, I don't know how to fix it. I can unzip my .jar, but there's nothing in the file, and even if there was, I wouldn't know how to put it back together.

Thanks in advance.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

When you export your project in a JAR file, one step of the export wizard is called "JAR Manifest Specification". In this page, you can select your own MANIFEST file. So make one, specify which class is the main class, and JAR everything using that file.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: Compiling into a .jar on Eclipse
It's not a secret anymore!