Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Jar Executable File Not Working

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    28
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Jar Executable File Not Working

    Hello! I recently finished a program, and I want to make it into a jar executable file, but it always comes up with this message whenever I try to run the jar file that gets created:

    Failed to load Main-Class manifest attribute from C:\Users\Computer\Documents\JCreator LE\MyProjects\Madlibs\classes\Madlibs.jar

    This is what I have for the "Arguments" part of the "Create Jar File" tool:

    cvf $[PrjName].jar manifest.txt *.class

    This is what I have in the manifest file:

    Main-Class: Project


    There is a new line after that, and the class is indeed named "Project." I'm really not sure why it can't load it. Can anyone help? Thanks in advance!


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: Jar Executable File Not Working

    It should be a manifest.mf file, not a manifest.txt file.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Jar Executable File Not Working


  4. #4
    Junior Member
    Join Date
    Jun 2010
    Posts
    28
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Jar Executable File Not Working

    Thanks, but the main problem is that I've done it like this before, and it worked. For some reason, it refuses to work even though I specified the main class. Also, how do you make a manifest.mf file?

  5. #5
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Jar Executable File Not Working

    What is the error when you try running it? Please paste it here in it's entirety.

  6. #6
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Jar Executable File Not Working

    Last edited by Darryl.Burke; October 15th, 2010 at 12:10 AM. Reason: added underline for link

  7. #7
    Junior Member
    Join Date
    Jun 2010
    Posts
    28
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Jar Executable File Not Working

    This is the error I keep getting:

    Failed to load Main-Class manifest attribute from C:\Users\Computer\Documents\JCreator LE\MyProjects\Madlibs\classes\Madlibs.jar

    The thing is, I actually did specify the class in the manifest file.

Similar Threads

  1. Cannot seem to get this working
    By OttawaGuy in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 28th, 2010, 03:41 PM
  2. Jar Executable File
    By The_Mexican in forum What's Wrong With My Code?
    Replies: 43
    Last Post: June 23rd, 2010, 03:53 PM
  3. [SOLVED] Executable .jar file isn’t launched after being double-clicked
    By voltaire in forum Java Theory & Questions
    Replies: 6
    Last Post: May 18th, 2010, 03:37 PM
  4. Making executable JAR more "executable"
    By ni4ni in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 1st, 2010, 01:19 PM
  5. Replies: 4
    Last Post: January 27th, 2009, 12:03 AM