aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes strange case with jar tool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "strange case with jar tool" Watch "strange case with jar tool" New topic

strange case with jar tool

John Chien
Ranch Hand

Joined: Feb 06, 2003
Posts: 105
In order to create jar file, I did the following for my server.jar.
1) change to classes directory
2) create a to be imported manifest file called
with it content:
Main-Class: suncertify.server.Server
3) I create jar by issuing
jar -cvmf ServerManifest.MF server.jar suncertify/db suncertify/server
4) I tried to run the server using
java -jar server.jar 1099
It failed.
5) I checked the jar file
jar -tvf server.jar
The suncertify.server.Server is there
6) I checked the content of Manifest.MF
It does not include the statement I put in ServerManifest.MF
7) I tried to merge them
jar ufm server.jar ServerManifest.MF
The result is the same.
I do not think that the jar command I used are wrong.
Question: What's wrong with jar tool ? Why can't I get the result I want. I am using JSDK 1.4.1_02
John Chien

SCJP, SCJD, SCWCD, SCBCD<br />IBM Certified Specialist (158)<br />Oracle9i PL/SQL Developer Certified Associate
John Chien
Ranch Hand

Joined: Feb 06, 2003
Posts: 105
I found the solution.
I think my brain is not clear today.
The book told me that the file to be inserted into the real manifest file should end with a carrige return or new line. Otherwise, it won't work.
I just forget what the book said.
Sorry to bother you.
John Chien
Have you tried LearnNowOnline?
subject: strange case with jar tool