I’ve made some Java application, and I want to make executable JAR file. I’ve tried to use “Export”->”Runnable JAR file”, and it works, but my application contains folders with images, and application executes without any images! But if I try to use “Export”->”JAR file”, I make JAR file, but I can’t execute it – click by file and get nothing! I choose main class, any resources, but my JAR file doesn’t execute. Please, tell me, how can I fix it?
Share
It all depends on how the images are loaded/used in your Java code. What works best for me, is to have a folder (package) in your project called something appropriate (e.g. “res” or “resources”) and put everything that is not java code in there. Then you can load your resources using URLs that point to these resources. See example below: