Search code examples
javajararchive

What's the best way of storing and extracting files inside the .jar archive?


I am looking for a way to store files inside the jar (and extract them), but it must work when running/debugging from Eclipse as well.

explanation: Storing files as in images that I want to use for an icon of a Frame. I hope it's clear now.


Solution

  • I still think that the question is a bit unclear.

    What is it that you want to do? You can create and read from jar-files using JarInputStream/JarOutputStream, and you can also read files from jar-files that are on the classpath using Class.getResourceAsStream(String name)