Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-29-2013, 10:30 AM   PM User | #1
Hydrian
New Coder

 
Join Date: Aug 2012
Posts: 40
Thanks: 5
Thanked 0 Times in 0 Posts
Hydrian is an unknown quantity at this point
JAVA Update Problem

Hey guys, i recently updated java. My game im working on wasent having problems running on its own in a .jar file untill i exported it into the release. Now when i try to run the .jar it loads and then crashes. This didn't happen before i updated java.

reasons why?
Hydrian is offline   Reply With Quote
Old 01-29-2013, 01:30 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,644
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Launch it from the command line, and it should give you a trace stack for the cause of the crash.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 01-29-2013, 08:42 PM   PM User | #3
Hydrian
New Coder

 
Join Date: Aug 2012
Posts: 40
Thanks: 5
Thanked 0 Times in 0 Posts
Hydrian is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
Launch it from the command line, and it should give you a trace stack for the cause of the crash.
Yeah, my friend did, it gave me a bunch of errors that i cant even find.
Hydrian is offline   Reply With Quote
Old 01-29-2013, 08:53 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,644
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
If the command line launch indicates errors, than the errors are definitely there. Without knowing what the errors are, then we can't help you in what to even look for.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 01-30-2013, 06:25 AM   PM User | #5
Hydrian
New Coder

 
Join Date: Aug 2012
Posts: 40
Thanks: 5
Thanked 0 Times in 0 Posts
Hydrian is an unknown quantity at this point
Here are the errors

Code:
  1. Exception in thread "main" java.lang.ExceptionInInitializerError at com.cmstudios.Voruius.graphics.Sprite.<clinit>(Sprite.java:11) at com.cmstudios.Voruius.entity.mob.Player.<init>(Player.java:25) at com.cmstudios.Voruius.Game.<init>(Game.java:51) at com.cmstudios.Voruius.Game.main(Game.java:138) Caused by: java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1388) at com.cmstudios.Voruius.graphics.SpriteSheet.load(SpriteSheet.java:28) at com.cmstudios.Voruius.graphics.SpriteSheet.<init>(SpriteSheet.java:23) at com.cmstudios.Voruius.graphics.SpriteSheet.<clinit>(SpriteSheet.java:17) ... 4 more
Sprite.class http://pastebin.com/wdwSPSFZ
Player.class http://pastebin.com/NU8eRmuJ
Game.class http://pastebin.com/8wkzHut1
SpriteSheet.class http://pastebin.com/epVDAKci

Last edited by Hydrian; 01-30-2013 at 06:28 AM..
Hydrian is offline   Reply With Quote
Old 01-30-2013, 02:43 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,644
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
The error indicates that the ImageIO.read is tossing an IllegalArgumentException in SpriteSheet.load. So the call to SpritSheet.class.getResource(path)) is returning null, which throws an IllegalArgumentException from load, which goes back to the constructor and finally to the static initializer.

Resource loading is not something I'm good with. At all. It always takes me a long time to get it right. Java's a bit confusing since there's two different types, one hinged off of class, and the other hinged off of classLoader. Last time I did this, I'm pretty sure I simply gave it an absolute path from the class path using /path/to/image nested in that structure from the project root, and then loaded it using MyClass.class.getClassLoader().getResource(thatpath). But looks to me that the only problem you have is the loading of the image resource itself.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:07 AM.


Advertisement
Log in to turn off these ads.