facebook

Failed to create executable jar file

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #224102 Reply

    everZ
    Member

    😆
    Hi, I have tried to create a jar file with MyEclipse through Export. It did not give me any error message. But it failed when I ran jar file. The error is a common one:
    Failed to load Main-Class manifest attribute from DWD.jar.

    The online articles said the error is related to MANIFEST.MF. But the guy also said ” I would recommend you to use an IDE like Eclipse.
    It provides you with an JAR Export routine, in which you cal look for main class. It automatically creates an MANIFEST.MF ” (http://forum.java.sun.com/thread.jspa?threadID=549376&messageID=2680601). I am wondering whether MyEclipse can create executable jar file directly or a post processing of jar file is needed?

    Thank,

    Everett

    #224108 Reply

    Riyad Kalla
    Member

    Moving to OT > soft dev, this isn’t related to MyEclipse.

    #224109 Reply

    Riyad Kalla
    Member

    Everett,
    The basic JAR exporting is provided by the base Eclipse (www.eclipse.org) IDE, not MyEclipse (J2EE addon to Eclipse). That being said, your MANIFEST file likely needs a line like:

    
    Main-Class: com.whatever.dwd.Main
    

    where you would put your full path to your Main class where I wrote com.whatever.blahblahbl. Then stick this in your META-INF dir inside of the JAR, or just make it part of your source tree, so when it gets zipped it is already there.

    Then when people double click the JAR, and have Java fully installed, it will launch it.

    #224163 Reply

    everZ
    Member

    Hi Riyad:
    Looks like I skipped some steps in creating jar file. I have followed the instructions and made it work. Thanks. Everett

    #224164 Reply

    Riyad Kalla
    Member

    Glad to hear it.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Failed to create executable jar file

You must be logged in to post in the forum log in