开发者

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 开发者_如何学Pythonfrom 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.


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)


I don not get your question clearly. Eclipse can export runnable jar files , right click on the project name and choose export. Then from the dialog choose runnable jar file under java category.


Creating JAR file using Eclipse IDE is pretty much easy.

Follow the simple steps.
1. Right click on your project, which you want to create a JAR file.
2. Select Export from the context menu.


Eclipse understands Ant build files. Write a build file that (compiles &) Jar's the code at the same time and this becomes a non-issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜