This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Difficulty in adding own manifest file    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Difficulty in adding own manifest file    " Watch "Difficulty in adding own manifest file    " New topic
Author

Difficulty in adding own manifest file

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
I create a folder w in which i have a java class in package my.Wen i use
D:\>jar cf qwe.jar w
jar file successfully creataed
but when i add a manifest file which has content
Main-Class: my.Test

I also press enter after my.Test
Now when i execute it in cmd
D:\>jar cmf qwe.jar man w
i get this error
java.io.FileNotFoundException: qwe.jar (The system cannot find the file specified)
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)
I didn't understand this error
Thanks
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3742
    
  16
The manifest file has to come before the jar file.
Try
jar cmf man qwe.jar w


Joanne
 
Have you checked out Aspose?
 
subject: Difficulty in adding own manifest file
 
It's not a secret anymore!