Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jar drive me crazy

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
Are you on UNIX/LINUX? If so, could it be because manifest is lowercase in the second example?
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jar drive me crazy too, but it was all going down hill after the Ewoks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic