• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

JAR or zip

 
Ranch Hand
Posts: 3851
  • Mark post as helpful
  • send pies
  • 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: 43016
76
  • Mark post as helpful
  • send pies
  • 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: 3851
  • Mark post as helpful
  • send pies
  • 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: 3851
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry guys.

It actually overrided old files (since I unzipped in the same folder).
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
I once met a man from Nantucket. He had a tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic