Java experts, please help!

Posted by (twitter: @WarlordMittens)
April 20th, 2015 1:18 pm

So for the first time ever, I’ve actually managed to make a playable game. But for some reason I can’t export it properly.

After I’ve exported it from eclipse, using the “Package required libraries into generated JAR”, and tried to run it, nothing happens.

I think this has something to do with the external libraries I’m using (Java Audio Player). I’ve already checked the Main class-path in MANIFEST.MF. Normally I would just search for the solution, but I can’t seem to find anything that I haven’t already tried.

Tags: , ,


15 Responses to “Java experts, please help!”

  1. oskardevelopment says:

    If you start the game with the command prompt, “java -jar “game”” – what does the command prompt say was the problem?

    • AdamW says:

      It gives me a “ExceptionInInitializerError” where I load spritesheets from my res folder.

      • oskardevelopment says:

        Could you print the whole text? “ExceptionInInitializerError” only tells me that an exception was thrown within an static initializer block – doesn’t tell me the exact cause. If I would guess it’s a problem with getting a resource, as the path to the resource have changed as you’ve packed it in a JAR.

        • AdamW says:

          Exception in thread “main” java.lang.ExceptionInInitializerError
          at com.lepraproductions.lududmdare32.graphics.Sprite.(Sprite.jav
          a:11)
          at com.lepraproductions.lududmdare32.Level.(Level.java:35)
          at com.lepraproductions.lududmdare32.Game.(Game.java:30)
          at com.lepraproductions.lududmdare32.Main.(Main.java:43)
          at com.lepraproductions.lududmdare32.Main.main(Main.java:137)
          Caused by: java.lang.NullPointerException
          at com.lepraproductions.lududmdare32.graphics.SpriteSheet.(SpriteS
          heet.java:32)
          at com.lepraproductions.lududmdare32.graphics.SpriteSheet.(Sprit
          eSheet.java:17)
          … 5 more

  2. Msquirrel says:

    Are you using a library like slick2D by any chance?

  3. Msquirrel says:

    My mistake, didn’t read, you’re using Java audio player, Ok, I would recommend trying to use Jar Splice, then add your game’s .jar and the jar for the audio library. Then let jar splice created you an executable jar containing all of it.

  4. AdamW says:

    Thanks for all the help. The problem is now solved (almost), so that I can export and submit my game!

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]