wood burning stoves 2.0*
The moose likes Java in General and the fly likes Manifest - JAR file - Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Manifest - JAR file - Exception" Watch "Manifest - JAR file - Exception" New topic
Author

Manifest - JAR file - Exception

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
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)


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
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.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
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.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Did you check the manifest in the jar to see what ended up in it?
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Manifest - JAR file - Exception
 
Similar Threads
Manifest problem in creating a jar file (CLI)
manifest file
Updating a JAR manifest
Creating jar file for EJB
jar problem