Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2013 8:44 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Exporting JARs.
PostPosted: Wed Jul 11, 2012 11:05 am 
Offline
User avatar

Joined: Wed Jun 20, 2012 10:33 pm
Posts: 35
Location: Doncaster, South Yorkshire
I've been using to JarSplice to put all of my Jars of one project into one big Jar for a while now, and had no problems.

And then, when I tried to use it today, I recieved no error messages in the program itself, but then my program wouldn't run. When I tried to run it through the CMD, I recieved the following:

Code:
C:\TakeFlight>java -jar GeorgeTakesFlightv2.jar
Wed Jul 11 12:03:11 BST 2012 INFO:Slick Build #274
Wed Jul 11 12:03:11 BST 2012 INFO:LWJGL Version: 2.8.4
Wed Jul 11 12:03:11 BST 2012 INFO:OriginalDisplayMode: 1366 x 768 x 32 @60Hz
Wed Jul 11 12:03:11 BST 2012 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz
Wed Jul 11 12:03:12 BST 2012 INFO:Starting display 800x600
Wed Jul 11 12:03:12 BST 2012 INFO:Use Java PNG Loader = true
Wed Jul 11 12:03:12 BST 2012 INFO:Controllers not available
Exception in thread "main" java.lang.RuntimeException: Resource not found: res/t
akeFlightEXIT.png
        at org.newdawn.slick.util.ResourceLoader.getResourceAsStream(ResourceLoader.java:69)
        at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:169)
        at org.newdawn.slick.Image.<init>(Image.java:196)
        at org.newdawn.slick.Image.<init>(Image.java:170)
        at org.newdawn.slick.Image.<init>(Image.java:158)
        at org.newdawn.slick.Image.<init>(Image.java:136)
        at george.game.takeflight.Menu.init(Menu.java:31)
        at george.game.takeflight.Game.initStatesList(Game.java:23)
        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 george.game.takeflight.Game.main(Game.java:33)

I don't know how to solve this, as I can't see any problems with the PNGs. It's also not just that one image, it doesn't seem to be able to find any of them.

Thanks!


Last edited by Delinitor on Wed Jul 11, 2012 11:32 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 11:10 am 
Offline

Joined: Mon May 07, 2012 11:36 pm
Posts: 93
Post the relevant resource loading code. Might be able to work something out from there :)


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 11:34 am 
Offline
User avatar

Joined: Wed Jun 20, 2012 10:33 pm
Posts: 35
Location: Doncaster, South Yorkshire
Code:
Image jensonButtonPlay;
Image jensonButtonExit;

public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
      jensonButtonPlay = new Image("res/takeflightPLAY.png");
      jensonButtonExit = new Image("res/takeflightEXIT.png");
}


There you go :P


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 11:46 am 
Offline

Joined: Mon May 07, 2012 11:36 pm
Posts: 93
Hmm, try putting public before Image, export, and build with jarsplice again. Don't know if it will work, but it's worth a try lol


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 11:49 am 
Offline
User avatar

Joined: Wed Jun 20, 2012 10:33 pm
Posts: 35
Location: Doncaster, South Yorkshire
Nope, that didn't do it :/


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 11:56 am 
Offline

Joined: Mon May 07, 2012 11:36 pm
Posts: 93
Whats the inside of the jar like? I mean, are all your folders and stuff present?


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 11:59 am 
Offline
User avatar

Joined: Wed Jun 20, 2012 10:33 pm
Posts: 35
Location: Doncaster, South Yorkshire
Everything appears to be in order D: It definitely works in Eclipse.


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 12:05 pm 
Offline

Joined: Mon May 07, 2012 11:36 pm
Posts: 93
Just noticed something


Exception in thread "main" java.lang.RuntimeException: Resource not found: res/takeFlightEXIT.png

jensonButtonExit = new Image("res/takeflightEXIT.png");

Uppercase and Lowercase F in Flight. Might be the reason :O


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 12:08 pm 
Offline
User avatar

Joined: Wed Jun 20, 2012 10:33 pm
Posts: 35
Location: Doncaster, South Yorkshire
AtomizerZero wrote:
Just noticed something


Exception in thread "main" java.lang.RuntimeException: Resource not found: res/takeFlightEXIT.png

jensonButtonExit = new Image("res/takeflightEXIT.png");

Uppercase and Lowercase F in Flight. Might be the reason :O


THANKYOU SO MUCH!!!!!!!!1111eleven

This was the problem, haha.


Top
 Profile  
 
 Post subject: Re: Exporting JARs.
PostPosted: Wed Jul 11, 2012 12:10 pm 
Offline

Joined: Mon May 07, 2012 11:36 pm
Posts: 93
Hahaha :D no problem man! Glad to be of some help ^_^


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group