aspose file tools*
The moose likes Java in General and the fly likes Jar drive me crazy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Jar drive me crazy" Watch "Jar drive me crazy" New topic
Author

Jar drive me crazy

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi all
I have the following dir:
dir\com // dir for class files
dir\images // dir for images
I have tried the following command:
jar cfv MyJar.jar com/*.class images/*.gif
then:
jar cvmf MANIFEST MyJar.jar com/*.class images/*.gif
(this manifest includes the Main-Class property with "com.Manager value")
and the jar is runnable and no problem..
and now when trying these commands, the jar dosen't include the images !!
then I have changed the command to
jar cvmf manifest MyJar.jar com images
its include the images but its not runnable (I have extracted the jar and the manifest it all right and every thing is as I want)
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31079
    
163

John,
Are you on UNIX/LINUX? If so, could it be because manifest is lowercase in the second example?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

I am using Windows XP.
I am always used the first two commands and they always work very well.
today, I want to package my application , and I faced this problem...
Maarten Vergouwen
Ranch Hand

Joined: Jan 12, 2004
Posts: 60
Are you running the JAR from inside an IDE?
If so, you might experience different behaviour when running it outside the IDE, since some IDEs (like NetBeans) have their own path settings which they apply.
Hence, when you run it from the IDE it works fine, and when you run it outside it suddenly cant find all of the files (or viceversa).
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

I have alwayes used command limes to package my applications.
after downloading netbeans, I am unable to use the first two commands (unable means, they don't work)
(please note, I am not creating my jar using netbeans, and trying to run it using it)
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Jar drive me crazy too, but it was all going down hill after the Ewoks.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
Don't get me started about those stupid light bulbs.
 
subject: Jar drive me crazy