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 3 of 3

Thread: Main-Class manifest attribute

  1. #1
    Member
    Join Date
    Oct 2011
    Posts
    37
    My Mood
    Where
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Main-Class manifest attribute

    So, I was trying to run a Jar I compiled and this "Failed to load Main-Class manifest attribute from
    text.jar" Came up. I looked up the issue and tried to fix the Manifest, however whatever I try fails. Can anyone help me with this?


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    989
    Thanks
    7
    Thanked 207 Times in 183 Posts

    Default Re: Main-Class manifest attribute

    Where did you look? If you haven't done so read Setting An Application's Entry Point and surrounding sections of Oracle's Tutorial. Take special note of the warning "The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return" which is a common gotcha.

    If you continue to have problems it would make things clearer if you posted the actual manifest file you are using, the command you use to create the jar file and the source (.java) file of the class containing the entry point.

  3. #3
    Member
    Join Date
    Oct 2011
    Posts
    37
    My Mood
    Where
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Main-Class manifest attribute

    Ok. I was using Eclipse to do this and it turns out I didn't actually select runnable Jar file, just ordinary jar file. That was why it wasn't working. Thanks for the help though!

Similar Threads

  1. [SOLVED] Not finding main class
    By drimades in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 9th, 2012, 02:29 PM
  2. [SOLVED] How to make a class be static if it's the main class.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 18
    Last Post: January 10th, 2012, 05:14 AM
  3. [SOLVED] no main manifest attribute, in Exampletut.jar
    By Java Programmer in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 7th, 2012, 03:31 PM
  4. How do I call a class in a main class
    By Leprechaun_hunter in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 26th, 2011, 04:11 AM
  5. could not find the main class
    By Tisofa in forum Object Oriented Programming
    Replies: 1
    Last Post: September 27th, 2009, 03:58 AM