• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAR or zip

 
ankur rathi
Ranch Hand
Posts: 3830
  • 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.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • 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: 3830
  • 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: 3830
  • 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: 42969
73
  • 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.
 
Dawid Augustynowicz
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.
 
Antonio Emilio Di Matteo
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic