I'm newish to java programming and I'm working on a simple 2 dimensional game. The game runs perfectly in eclipse but when I create and launch the Runnable Jar (which I created by exporting with eclipse), it creates a grey window with the correct height and Width defines by the main Class but it doesn't render anything or give me an error.
when I try to run it in the cmd prompt, instead of clicking on it, with the line java -jar LokiJar.jar it gives me this error: unable to access jarfile LokiJar.jar (LokiJar,jar is the name of the jar file)
here is my Class that handles the pngs
public class Sprites {
public static Sprite[][] terrain = SpriteSheetLoader.cutTiles("/Resources1/tiles.png",16, 16);
public static Sprite[][] level = SpriteSheetLoader.cutTiles("/Resources1/superBigMap.png",64, 64);
public static Sprite[][] deppe = SpriteSheetLoader.cutTiles("/Resources1/deppe.png",16, 16);
public static Sprite[][] trigger = SpriteSheetLoader.cutTiles("/Resources1/trigger.png",16, 16);
public static Sprite[][] attack = SpriteSheetLoader.cutTiles("/Resources1/attack.png",5, 5);
public static Sprite[][] tab = SpriteSheetLoader.cutTiles("/Resources1/tab.png", 16, 64);
public static Sprite[][] menu = SpriteSheetLoader.cutTiles("/Resources1/menu.png", 240, 200);
}
Just to reiterate, it runs correctly in eclipse, opens a window of a certain size and renders images to it, but with the jar it just opens the correct size window but doesn't render anything or give me an error (as far as I can tell).
Aucun commentaire:
Enregistrer un commentaire