• Post Reply Bookmark Topic Watch Topic
  • New Topic

making a jar file of images  RSS feed

 
yo misma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I'm trying to make a jar file that only contains images, and although i can do it when i try to load the images in my application(stored in a different path) it rises an I/O exception:

IOException: java.io.FileNotFoundException: JAR entry aire_on.gif not found in c:\images\images.jar

But it does not make sense, since the jar file is created an the images are stored there. I'm not sure but maybe it is not allowed to make a Jar file that does not contain any class (only images).

Can anyone help me?
Thanks
 
Stefan Willi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you access the files? Please, post your code!

Generally, it should be not a problem, to read files from a jar-file.

If you read the jars content via the classloader (getClass().getResource()), then you have to ensure, that the jar is on your classpath.

I know, this is maybe not a very usefull answer, but perhaps a point of starting for you.

Post your code and we can help you with your special problem.

stefan
[ April 14, 2005: Message edited by: Stefan Willi ]
 
Stefan Willi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are a small example:

Assuming, your jar in on classpath and include a file named "links.jpg".

Stefan
 
yo misma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks but I want to access a jar file in the C:/ root path, not in the same path of my class
 
Stefan Willi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add your jar to your classpath, then the location of your jar can be anywhere.

Stefan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!