Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

How to run a java bean

I have this mainifest file:
Manifest-Version: 1.0

Name:SimpleBean.class
Java-Bean: true

Use this command to make Jar:
jar cfm SimpleBean.jar manifest.tmp SimpleBean.class

Actually the source code has been compiled,but there are
such Exceptions while executing:
java.io.IOException:invalid manifest format
at java.util.jar.Manifest.read(Manifest.java:183)
at java.util.jar.Manifest.<init>(Manifest.java:59)
at sun.tools.jar.Main.run(Main.java:124)
at sun.tools.jar.Main.main(Main.java:778)

Why?
[571 byte] By [Bean Bean] at [2007-11-9 21:18:33]
# 1 Re: How to run a java bean
Something is wrong with your manifest file !

Check the file attributes of it,
make it read/writeable for everybody !

Try "jaring" again...
tomdee at 2007-11-11 23:08:16 >
# 2 Re: How to run a java bean
How to create a manifest file

Name: SimpleBean.class
Java-Bean: True

save the manifest file with the extension .mft

leave a space between Name: and The class file .
leave a space between Java-Bean: True.

now create the jar file

jar cfm SimpleBean.jar manifest.mft SimpleBean.class

steps for packaging a bean.

create a package under c:\bdk1.2\demo\sunw\demo

while creating the package issue the statement

package sunw.demo.packagename;

under this package create the bean

compile it.

create the mft file under c:\bdk1.2\demo.

Name: sunw/demo/packagename/classfilename
Java-Bean: True

now create the jar file.

jar cfm ..\jars\SimpleBean.jar manifest.mft sunw\demo\packagename\classfilename

now the jar file is put under the jars directory.

once you run the run command from c:\bdk1.2\beanbox>run

it gets automatically loaded under toolbox in beanbox.

by

Radha Software Engineer.




"Bean Bean" <huiyuanm@uwyo.edu> wrote:
>
>
>I have this mainifest file:
>Manifest-Version: 1.0
>
>
>Name:SimpleBean.class
>Java-Bean: true
>
>
>Use this command to make Jar:
>jar cfm SimpleBean.jar manifest.tmp SimpleBean.class
>
>Actually the source code has been compiled,but there are
>such Exceptions while executing:
>java.io.IOException:invalid manifest format
>at java.util.jar.Manifest.read(Manifest.java:183)
>at java.util.jar.Manifest.<init>(Manifest.java:59)
>at sun.tools.jar.Main.run(Main.java:124)
>at sun.tools.jar.Main.main(Main.java:778)
>
>
>Why?
>
Radha at 2007-11-11 23:09:21 >