aspose file tools*
The moose likes Beginning Java and the fly likes jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jar files" Watch "jar files" New topic
Author

jar files

Munaf Sheikh
Greenhorn

Joined: Mar 31, 2008
Posts: 10
Hi,

Is it possible to add files other than Java files, like .txt and .bmp/.jpeg files into a jar file, so that when run with java -jar jvapackage.jar it sees the txt/image files. It doesn't have to be able to add/edit any files already IN the archive.

Thanks in advance,

Munaf
Munaf Sheikh
Greenhorn

Joined: Mar 31, 2008
Posts: 10
some more info:

I'm writing an Image Library where in I have several thousand images in folders and a few java classes do various things with the images. The images don't change and I want to jar them all together for portability.

Thanks again,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Originally posted by Munaf Sheikh:
Is it possible to add files other than Java files, like .txt and .bmp/.jpeg files into a jar file?
As far as I know, YES.

Have a look at This part of the Java Tutorials, particularly the bit about creating a .jar file. That appears to tell you how you can add pictures and text files to a jar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar files