简体   繁体   中英

executable JAR file not showing resources

i created an executable JAR file using eclipse.. I have resources in the project folder that does not appear when the frame is open..I mean when i double-click on the JAR file. More so,After I try to delete the JAR file I get a warning that the JAR file is being used on the Java Se platform .How can I eliminate this problem other than using a resource loader class?

有时,当我们运行一个jar文件时,jvm会占用资源,并且由于这些资源而无法释放它们,因此我们无法删除jar文件,因此请尝试从任务管理器中杀死进程,以便您可以删除jar文件。 explorer.exe正常运行。尝试终止该进程,然后尝试删除jar文件。

Use ClassLoader to get the InputStream if your resources is in the source folder.

ClassLoader.getResourceAsStream(String name);

Close your application before you delete the JAR file. Or explicitly exit your application with the following code.

System.exit(0);

There can be a possibility that the resources are not exported at all. Sometimes it happens that you need to tick the check box against each resource name and then hit finish while exporting it with Eclipse.

Also, please check that there is no warnings when the export process is finished.

Kill all the java.exe and javaw.exe process from task manager and then try to delete.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM