• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Jar packager  RSS feed

 
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to build an application that will put into a jar file 2 classes, a text file, my manifest, and all the files(subdirs included) in a directory. I then would like to take the jar that was created from this process and extract it to another computer with the relative directory structure intact.
I have posted several times to several places concerning where to get started. So, before people say "look in java.util.jar in the Java API". Know that I have and I find it woefully inadequate to address this question when I have never used streams or zips before.
If anyone has done this before, could you please share your source code?
Thanks!
Jason R. Kretzer
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could execute a command line argument to Jar this up with something like this:

Note that this is probably not the most eligant way of doing it, however, it does function.
Just build a commandLine to Jar up what you like, moving the extra files you want into the directory first.

[This message has been edited by Kenneth Reising (edited July 30, 2001).]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I'm facing the same problem with streams. I'm trying to extract files from a zip file. I search, using Yahoo, for ZipInputStream. That helped and my little app is now working.
Look at this: http://www.javaworld.com/javaworld/jw-11-1998/jw-11-howto_p.html, with code examples.
Cheers
Torgny
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!