I am trying to make a runnable jar of my project made in LWJGL. It works fine in Eclipse. I used JarSplice to make a FatJar, however it closed instantly upon running. The console, as well as some research http://stackoverflow.com/questions/12116151/fat-jar-instantly-closes , tells me it is a problem with my use of the FileInputStream.
Here is what my texture loading looks like:
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
public class ResLoader {
public static Texture loadTexture(String directory){
Texture tex = null;
try {
tex = TextureLoader.getTexture("PNG", new FileInputStream(new File(directory)), GL11.GL_NEAREST);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return tex;
}
}
How can I rewrite this without use of the FileInputStream?
Thank you