Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

packaging all packages in an executable jar file

 
abhishek kunal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a problem...please have a look on my project directory
spinner/
spinner/componets/
spinner/components/SpinnerDemo3.class
spinner/components/SpringUtilities.class
spinner/components/CyclingSpinnerModel.class
spinner/others/
spinner/others/check.class
spinner/gui/
spinner/gui/launcher.class
spinner/meta-inf
spinner/meta-inf/manifest.mf

so very obviously i have 3 packages , components, others and gui, now i want to make an executable jar file, so i run a command from spinner directory

jar -cvfm myexe.jar meta-inf/manifest.mf components/*.class gui/*.class others/*.class

so , in this way it worked well, but what i want is , i shdnt be specifying all packages...suppose i have 10 packages, so i will need to write all those in command and that i don't want , so is'nt there any wildcard for this? so that all packages are included in jar file automatically...??? in other words i want each and everything in spinner directory to be packaged in jar file without specifying all ....

hope my question is clear...please help!!
 
Daniel Matthews
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why dont you run the command from the directory above spinner. E.g. jar -cvf myjar.jar spinner/.

Surely if this is your package structure then you would need the spinner directory included anyway. Anyway if not try jar -cvf myjar.jar ./
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Abhishek,

*/*.class would work , but for each recursive directories , you need to add */*/*.class depending on... If your OS is unix , then there are other options.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic