• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar files

 
Munaf Sheikh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic