开发者

Taking an eclipse java project and packing it into a jar?

Right now i've written a simple SWT application using eclipse, and I want to pack it into an executable .jar file so I can give it out to friends and such. But I have the following problems: -Right now i'm reading files by using their filename in the program, and putting them in the root folder of the eclipse project. That works fine for running in eclipse, but w开发者_StackOverflow中文版hen I export to jar they're not in the jar. Is there a way to put them in the jar and access them in the code? -I also need the SWT .jar dependencies or whatever its called(the files you need for SWT).

Does anyone know how to do this?


Take a look at ClassLoader.getResourceAsStream() API.


All you need to do is include these files in the with the source code of your project, then to have access to then have a look at this link

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜