• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jar drive me crazy

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jar drive me crazy too, but it was all going down hill after the Ewoks.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic