0

I tried following a few tutorials of exporting eclipse project as JAR file and then converting it to exe file using Launch4j but it just doesn't work.

I have made a game in eclipse that has some photos as backgrounds and images as buttons in the game. When I start game in eclipse it works just fine. I tried to export it as JAR file, then convert it to exe file using Launch4j, but when I start the game frame appears blank, only my timer of the game is seen in the corner. When I tried this method I selected all of those additional things I used (images etc.) to be in my JAR file, but it still doesn't work. Do you have any idea what might be the problem and how to fix it?

PS: I tried this both with exporting JAR file and Runnable JAR file, it gave same results...

  • How do you access the assets? As resources? Files? – Dave Newton Jun 19 '21 at 14:36
  • This is usually caused by using file based APIs to read the images - objects in a Jar are not files - look at Class.getResourceAsStream see https://stackoverflow.com/q/31127/2670892 – greg-449 Jun 19 '21 at 16:30

0 Answers0