kappa wrote:
CNIAngel wrote:
Alright I export my project as a plain jar, exporting the main class files and resources inside the jar. I also have all my natives and jars in a separate folder. I go through the whole process of adding the plain jar and the lib jars (lwjgl, slick2d, and marteengine), adding the natives, and pointing it toward the main class. Finally I export the fat jar. I run it. It stays up for about 7-8 seconds more then before, but still closes.
I'm not quite sure what I'm missing that's making it do this.
If it gets that far that means its working but there is some runtime error with the application, you should run it on the cmd prompt and grab the exception that is thrown to get an idea on why its failing, you can run it on the command prompt by using "java -jar yourjarname.jar"
Alright I ran the jar in cmd and I know why it's breaking. When it tries to load my Tiled Map is says it's not found then crashes. Everything is referenced correctly or it wouldn't compile and run in Eclipse. So I'm at a loss as to how to fix it. Here the error.
Code:
Tue Aug 21 14:17:07 EDT 2012 INFO:Slick Build #274
Tue Aug 21 14:17:07 EDT 2012 INFO:LWJGL Version: 2.8.4
Tue Aug 21 14:17:07 EDT 2012 INFO:OriginalDisplayMode: 1280 x 800 x 32 @60Hz
Tue Aug 21 14:17:07 EDT 2012 INFO:TargetDisplayMode: 640 x 400 x 0 @0Hz
Tue Aug 21 14:17:07 EDT 2012 INFO:Starting display 640x400
Tue Aug 21 14:17:07 EDT 2012 INFO:Use Java PNG Loader = true
Tue Aug 21 14:17:07 EDT 2012 INFO:Controllers not available
Tue Aug 21 14:17:07 EDT 2012 DEBUG:Setting ResourceManager base directory to 're
s/'
Tue Aug 21 14:17:07 EDT 2012 DEBUG:Trying to load sound file 'Jump4.wav' at key
'jump'...
Tue Aug 21 14:17:07 EDT 2012 INFO:Initialising sounds..
Tue Aug 21 14:17:08 EDT 2012 INFO:- Sound works
Tue Aug 21 14:17:08 EDT 2012 INFO:- 64 OpenAL source available
Tue Aug 21 14:17:08 EDT 2012 INFO:- Sounds source generated
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load music file 'game_muzask.wav' a
t key 'muzask'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load image file 'winz.png' at key '
winz'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'littlered_id
le.png' with width 16 and height 16 without transparent color at key 'lr'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'littlered_ru
n.png' with width 16 and height 16 without transparent color at key 'lr_move'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'tile.png' wi
th width 16 and height 16 without transparent color at key 'tiles'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'coin.png' wi
th width 16 and height 16 without transparent color at key 'coin'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load spritesheet file 'portal.png'
with width 16 and height 16 without transparent color at key 'portal'...
Tue Aug 21 14:17:08 EDT 2012 DEBUG:Trying to load tiled map file 'Level_1.tmx' a
t key 'lvl1'...
Tue Aug 21 14:17:08 EDT 2012 ERROR:Resource not found: res//Level_1.tmx
java.lang.RuntimeException: Resource not found: res//Level_1.tmx
at org.newdawn.slick.util.ResourceLoader.getResourceAsStream(ResourceLoa
der.java:69)
at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:77)
at it.randomtower.engine.ResourceManager.loadTiledMap(ResourceManager.ja
va:126)
at it.randomtower.engine.ResourceManager.loadResources(ResourceManager.j
ava:95)
at it.randomtower.engine.ResourceManager.loadResources(ResourceManager.j
ava:44)
at com.cnia.angelworks.glr.SetUp.initResources(SetUp.java:44)
at com.cnia.angelworks.glr.SetUp.initStatesList(SetUp.java:31)
at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
at com.cnia.angelworks.glr.SetUp.main(SetUp.java:63)
Tue Aug 21 14:17:08 EDT 2012 ERROR:failed to load resource file 'res/resources.x
ml': Unable to load resource configuration file
Tue Aug 21 14:17:08 EDT 2012 ERROR:Resource loading failed!
org.newdawn.slick.SlickException: Resource loading failed!
at com.cnia.angelworks.glr.SetUp.initResources(SetUp.java:48)
at com.cnia.angelworks.glr.SetUp.initStatesList(SetUp.java:31)
at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
at com.cnia.angelworks.glr.SetUp.main(SetUp.java:63)
AL lib: FreeContext: (05450C28) Deleting 64 Source(s)