• 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 or zip

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Please let me know what to create.

Assignment mentions JAR and mail mentions zip. If JAR, then how to create JAR of some HTML files and images.

Thanks a ton.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the jar command line tool to create jar files. See http://java.sun.com/docs/books/tutorial/deployment/jar/basicsindex.html for details.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
You can use the jar command line tool to create jar files. See http://java.sun.com/docs/books/tutorial/deployment/jar/basicsindex.html for details.



Thanks Ulf.

I created a jar using following command: jar cf test.jar *.*

But when I extract it using: jar xf test.jar

It just generates one META-INF folder and MANIFEST.MF file inside it. Where are html files and images?

Thanks!
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry guys.

It actually overrided old files (since I unzipped in the same folder).
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use "jar tf test.jar" to list the contents of the jar file. If you use "jar xf" right after "jar cf", then all files in the directory will be overwritten by the contents of the jar file, so you wouldn't notice any additional files.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can just simply zip your files and rename result file to jar. Jar files are just zipped files with .jar extension.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi to all,
I've submitted my assignment this morning, the jar with "jar cvf scea-xxxx.jar scea-xxxx/*"

only one doubt, if you use "jar xf scea-xxx.jar" you can see all the files in the cwd, but if you extract with winrar/winzip su see a dir scea-xxxx that contains all the files.

It's ok or I've made a mistake? :-S


Thanks in advance.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic