manifest files not loading

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Murat Tasan

    manifest files not loading

    hi, i'm having a very odd problem... here is my system:

    debian linux
    java: j2sdk 1.4.1_02

    everything is running fine, except for one little problem... i have a
    custom manifest file called manifest.txt:

    Main-Class: UserInterface

    that is the only line in the file... sweet.

    so i'm in the directory with my class files (including
    UserInterface.c lass, which has the main entry function)

    so at the line:
    [color=blue]
    > jar cvmf manifest.txt jarfile.jar *.class[/color]

    everything gets added, and the first line of the verbose output is that
    the manifest is added...

    but when i try to use:
    [color=blue]
    > java -jar jarfile.jar[/color]

    i get the output saying that the Main-Class attribute for jarfile.jar
    failed to load...

    so i extract the archive and look at the manifest file...

    no entry for Main-Class.

    i try switching the "m" and the "f" from the command line (thereby
    switching the order of the files listed, too)... but no luck.

    i try creating an archive without a manifest ("M" option), and add the
    custom one later (the "umf" option)... still pops in a default manifest,
    with no reference to a Main-Class attribute....

    i'm at wits end... is there maybe a bug in the linux release?

    hopefully?

    help me, please!

    thanks!

    murat

    --
    Murat Tasan
    [email protected] u
    [email protected] .edu
    murat.tasan@cwr u.edu


  • Phil

    #2
    Re: manifest files not loading

    I was under the impression that the manifest file
    had to be in the directory "META-INF" and have the
    name "MANIFEST.M F"
    Is this not true?

    Phil...

    "cvissy" <c.k.b@webmail. co.za> wrote in message news:5120b39a.0 308180411.5e490 [email protected] gle.com...[color=blue]
    > Hi there,
    >
    > I have had the same problem before and you wont believe what I found
    > was wrong...... I didnt have an end of line character?!?
    >
    > Honestly!! when I just wrote the line
    >
    > Main-Class: Whatever
    >
    > and didnt press enter after 'Whatever', the manifest file in the jar
    > was not updated..
    >
    > try this, Im not promising anything tho.[/color]

    Comment

    • cvissy

      #3
      Re: manifest files not loading

      Hi,
      [color=blue]
      > I was under the impression that the manifest file
      > had to be in the directory "META-INF" and have the
      > name "MANIFEST.M F"
      > Is this not true?[/color]

      it is true.... the jar utility creates a default manifest file...
      "MANIFEST.M F" in the "META-INF" directory, but this just has default
      information.

      You can add your own custom information to the default manifest by
      creating another file (it can be named anything - im partial to
      'man' because it is short). All i put in my 'man' file, when i want
      to make the jar executable, is the string indicating the main class.
      then i run the script

      jar -cvfm myJar.jar man *.*

      and it jars everything , however it does put the 'man' file in the jar
      too but it doesnt affect anything (you can prevent that by being more
      specific about the files yu want included in the jar)

      Comment

      Working...