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.
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.
Originally Posted by Fou-Lu
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.
Here are the errors
- Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalArgumentException: input == null!
... 4 more
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.