Forums Register Login

packaging all packages in an executable jar file

+Pie Number of slices to send: Send
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!!
+Pie Number of slices to send: Send
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 ./
+Pie Number of slices to send: Send

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.
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 998 times.
Similar Threads
Help with building executable jar with ant.
creating jar
Jar executable won't run when copied into desktop
jar executable won't work when copied into desktop
Diff. Btwn EAR, WAR, & JAR Files????
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:22:00.