I am trying to create a jar file containing EJB Home,EJB remote,EJB bean,client files and deployment descriptor.My EJB Home,remote and bean classes are in C:\EJB and my client classes and deployment descriptor are in C:\EJBClient.These folder contains both java and classs files.Now to jar these files I am issuing following command :
C:\>jar cfm test.jar EJB\*.java EJBClient\*.java EJB\ejb-jar.xml
then it gives following error:
java.io.IOException:invalid header field
at java.util.jar.Attributes.read(Attributes.java:383)
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.run.(Main.java:904)
Please tell me whats wrong with the syntax.
-
Problem in creating jar file for EJB (2 messages)
- Posted by: chanchal malik
- Posted on: May 06 2004 10:34 EDT
Threaded Messages (2)
- Problem in creating jar file for EJB by Paul Strack on May 06 2004 11:07 EDT
- Problem in creating jar file for EJB by chanchal malik on May 06 2004 11:31 EDT
-
Problem in creating jar file for EJB[ Go to top ]
- Posted by: Paul Strack
- Posted on: May 06 2004 11:07 EDT
- in response to chanchal malik
The "m" switch in "cfm" indicates that you are using your own manifest rather than allowing the jar tool to create the manifest. The jar tool therefore expects the first parameter after "cfm" to be a manifest file, but you are putting the jar name.
Also, the jar code should operate on .class files, not .java files, so you need to compile your Java code before using jar.
Change your operations as follows:
set CLASSPATH=bin;[add j2ee jars to your classpath]
javac -d bin EJB\*.java
javac -d bin EJBClient\*.java
jar cf test.jar bin\* EJB\ejb-jar.xml -
Problem in creating jar file for EJB[ Go to top ]
- Posted by: chanchal malik
- Posted on: May 06 2004 11:31 EDT
- in response to Paul Strack
Thanks Paul,
It worked.