Building jars in eclipse

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hirak1984
    Contributor
    • Jan 2007
    • 316

    Building jars in eclipse

    I have the following error while running a jar file built using eclipse==>
    "
    Failed to load Main-Class manifest attribute from C:\Documents and Settings\195156 \Workspace\tool 1.jar "

    tool1.jar is the name i have given to the jar file.

    The class that contains the "main(Strin g a[])" function is "test2.clas s"

    and i have 4 more classes.I have created a META-INF folder under the project root directory,and created a file named"MANIFEST. MF".
    Written the following lines in the file==>
    Manifest-Version: 1.0
    Main-Class:ZipSelfEx tractor

    Class-Path: lib/org.eclipse.swt .win32.win32.x8 6_3.1.1.jar

    I cant find the cause of error,please help me with it.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by hirak1984
    I have the following error while running a jar file built using eclipse==>
    "
    Failed to load Main-Class manifest attribute from C:\Documents and Settings\195156 \Workspace\tool 1.jar "

    tool1.jar is the name i have given to the jar file.

    The class that contains the "main(Strin g a[])" function is "test2.clas s"

    and i have 4 more classes.I have created a META-INF folder under the project root directory,and created a file named"MANIFEST. MF".
    Written the following lines in the file==>
    Manifest-Version: 1.0
    Main-Class:ZipSelfEx tractor

    Class-Path: lib/org.eclipse.swt .win32.win32.x8 6_3.1.1.jar

    I cant find the cause of error,please help me with it.
    The error is showing when you try to run the jar file not when creating the jar file right? Have a look at this.

    Comment

    • hirak1984
      Contributor
      • Jan 2007
      • 316

      #3
      Hey I have followed the steps written in the link,but it still didnt work.I dont know wat to do!!

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by hirak1984
        Hey I have followed the steps written in the link,but it still didnt work.I dont know wat to do!!
        Make sure that the last line in your mainifest is a blank line. Press enter after the last line.

        Comment

        Working...