根据的反馈意见。 URL toload resources from the categorypath in Java i 改变了我的项目,将我的形象资源纳入图像。 jar
www.un.org/Depts/DGACM/index_spanish.htm 我的项目设置 现在
/program.jar
/Images.jar
我的代码一
InputStream connectedImage = ClassLoader.getSystemResourceAsStream("images/logo.png");
我的迷信套
/src/...
/images/logo.png
<<>My problem
Eclipse cannot find the Systemresource based on that url. In order to get it to work, i have to
- Manually create Images.jar containing my image folder
- Add the Images.jar file to the Eclipse project
www.un.org/Depts/DGACM/index_spanish.htm 我需要的是。
How can i configure Eclipse so i can use the same code to load the image from either Images.Jar (if run from commandprompt) or from the images folder(if run from Eclipse)?
Is there any way to make Eclipse include my /images/ folder when creating a runnable jar file of my program? Currently it does not include anything besides refereced jar files and source code.