By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

manifest files not loading

P: n/a
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.class, which has the main entry function)

so at the line:
jar cvmf manifest.txt jarfile.jar *.class
everything gets added, and the first line of the verbose output is that
the manifest is added...

but when i try to use:
java -jar jarfile.jar


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
mx**@po.cwru.edu
ta***@eecs.cwru.edu
mu*********@cwru.edu
http://genomics.cwru.edu

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I was under the impression that the manifest file
had to be in the directory "META-INF" and have the
name "MANIFEST.MF"
Is this not true?

Phil...

"cvissy" <c.***@webmail.co.za> wrote in message news:51**************************@posting.google.c om...
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.

Jul 17 '05 #2

P: n/a
Hi,
I was under the impression that the manifest file
had to be in the directory "META-INF" and have the
name "MANIFEST.MF"
Is this not true?


it is true.... the jar utility creates a default manifest file...
"MANIFEST.MF" 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)
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.