Java Bean

Hi Every BodyI Order to Create a .Jar file the required Manifest file is not being included in the .jar file.It's rising a "FileNotFoundException"SO I hope there is somebody to help le over there
[224 byte] By [Kanthia] at [2007-10-3 11:09:37]
# 1

What do you use to create JAR file?

This is a part of my Ant buildfile:

<jar destfile="file.jar">

<fileset dir="classes"/>

<manifest>

<attribute name="Main-Class" value="package.Main"/>

</manifest>

</jar>

UncleSAMa at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 2
No I use Command Prompt to create jar file say,jar cfmname.jarmanifestname.jar classname.jar
Kanthia at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 3
hmmmm, too many .jaryou should use something like tis:jar cvfm name.jar manifestname -C classes/ .Type jar and read the manual.
UncleSAMa at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 4
Sorry Sir,That day I have posted you the wrong command I use,jar cfm name.jar manifestname.mft classname.classI'm extremely sorry for that
Kanthia at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 5
And? What is the result?
UncleSAMa at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 6
Sir,It's giving a "FileNotFoundException " for the Manifest File that the System cannot find it.Thanks.
Kanthia at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 7
Hmmm...Could you give me example?I can't reproduce FileNotFoundException.
UncleSAMa at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 8

Sir,

say the example is that i have a calculator developed by me n

i want to load it into the bean box .......

so i use the command ..

jar cfm calc.jar calc.mft calc.class

so from the above command the .mft file is not being recognised by the system n it is giving ....

E:\CALC>jar cfm calc.jar calc.mft calc.class

java.io.FileNotFoundException: calc.mft (The system cannot find the file specifi

ed)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(FileInputStream.java:106)

at java.io.FileInputStream.<init>(FileInputStream.java:66)

at sun.tools.jar.Main.run(Main.java:122)

at sun.tools.jar.Main.main(Main.java:903)

Kanthia at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 9

Ok. I have used jar wrom CygWin and it says (in such case):

Invalid manifest file specified.

Lets see at your example:

E:\CALC>jar cfm calc.jar calc.mft calc.class

calc.jar - the .jar file that will be created in E:\CALC folder

calc.mft - the manifest file should exist in E:\CALC folder

calc.class - the class file should also exist in E:\CALC folder

Check the name of calc.mft twice.

Is it exist in your folder?

UncleSAMa at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 10
Sir,I have checked , but it's giving the same output
Kanthia at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...
# 11
Sorry, but I have no ideas why jar.exe could not find existing file...
UncleSAMa at 2007-7-15 13:32:41 > top of Java-index,Desktop,Developing for the Desktop...