[Logo]
Forums Register Login
Manifest - JAR file - Exception
I created a manifest file for javabean and I am trying to
include it in the jar with the jar option (m), but I am
getting the following Exception. Some one please help me.

D:\vishnu\java\corejava>jar cfm ch.jar c1.mft

java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes.java:387)
at java.util.jar.Manifest.read(Manifest.java:167)
at java.util.jar.Manifest.<init>(Manifest.java:52)
at sun.tools.jar.Main.run(Main.java:124)
at sun.tools.jar.Main.main(Main.java:904)
There are a bunch of suggestions if you google on:

invalid header field jar manifest

If that doesn't help why don't you post the contents of your manifest, the exact command you are running and the resulting output.
This is my mft file and I had given new line after True.

Name: Check.class
Java-Bean: True


I compiled from the command prompt with this command and I didn't get
any error.

D:\vishnu\java\corejava>jar cfm ch.jar c1.mft Check.class

Now ch.jar, c1.mft, Check.java are all in the same directory

Then I executed the beanbox\run.jar
when I goto File menu and use the LoadJar Option to load the jar file
I get the following error


Jar file D:\vishnu\java\corejava\ch.jar didn't have any beans!

Each jar file needs to contain a manifest file describing which entries are
beans. You can should provide a suitable manifest when you create the jar.
Did you check the manifest in the jar to see what ended up in it?
I'm curious why you're using "beanbox".

I googled for beanbox tutorial and had a hard time finding the old original beanbox (today I searched for beanbox alone and all the pointers go right to the old beanbox BDK), instead I found the beanbox pointers actually going to Bean Builder. Beanbox has some issues with JDK 1.4: javabeans faq - When I run the BeanBox under J2SE v 1.4 I get an exception. What's going on here?... you mentioned this in a PM.

JavaBeans Beanbox Tutorial (points to sun page to download BDK, but now it looks like that page points to Bean Builder rather than BeanBox.

Sun's JavaBean page - reference to Bean Builder

The Bean Builder: A BeanBox for the new Millennium

Bean Builder Tutorial
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Oct 18, 2017 01:41:05.