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

Thread: no main manifest attribute, in Exampletut.jar

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Exclamation no main manifest attribute, in Exampletut.jar

    Main-Class: ExampleClass

    Im adding it while making the jar file but this is the error im getting?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: no main manifest attribute, in Exampletut.jar

    Use a zip utility to look in the jar file and make sure the manifest file is there and that it has the correct contents.
    What is the commandline with options that you are using to create the jar file?

  3. The Following User Says Thank You to Norm For This Useful Post:

    Java Programmer (January 7th, 2012)

  4. #3
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: no main manifest attribute, in Exampletut.jar

    jar cfmv exampletut.jar mainClass.txt ExampleClass.class ExampleClass2.class

    I looked at the manifest and it has no
    Main-Class: ExampleClass

    ?

    mainClass.txt =
    Main-Class: ExampleClass

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: no main manifest attribute, in Exampletut.jar

    Is the mainClass.txt file in the jar? It shouldn't be.

  6. #5
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: no main manifest attribute, in Exampletut.jar

    Quote Originally Posted by Norm View Post
    Use a zip utility to look in the jar file and make sure the manifest file is there and that it has the correct contents.
    What is the commandline with options that you are using to create the jar file?
    i forgot to hit enter after main-class: exampleclass.
    Thanks for trying!

Similar Threads

  1. Replies: 2
    Last Post: October 30th, 2011, 06:37 PM
  2. not able to get the context attribute set in ServletContextListener
    By jkoder70014 in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: August 17th, 2011, 11:47 AM
  3. how to pass value of table cell as parameter/attribute
    By ajincoep in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: February 8th, 2011, 09:51 AM
  4. [HELP] How can I retrieve attribute/method?
    By k4it0xtr3me in forum Object Oriented Programming
    Replies: 0
    Last Post: January 21st, 2011, 02:18 AM
  5. [SOLVED] XML get/set node by attribute value
    By b_jones10634 in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: August 24th, 2010, 11:26 AM