Reputation: 1254
I created a fat jar file using JarSplice, but when I launch it i get a window (the size is okay) and it closes after half a seccond...
In the "add jars" section I'm adding the jar file that I exported from Eclipse, and all library jars that I'm using. In the natives section I'm adding only Windows natives for lwjgl. I think I wrote the correct main class.
What am i doing wrong? How can I fix this problem?
Note: I'm using the newest version of eclipse and jdk.
Upvotes: 0
Views: 1362
Reputation: 26574
The file no longer is really on the "file system" but is instead in the jar, so you will need to load the resource from within the jar. When you run from within eclipse it is still on the file system, but when you create the jar it's not, that's why it works in eclipse but not when you package it up. The answer to this question should give you a good start on loading a file within a jar as a resource. That said, I'm not sure if you can do something similar to your listFiles
call.
Upvotes: 2