problem with jar file

hi there,

i recently made a game and now i want to make a runable jar file and then exe file of it.

this is my manifest file

Manifest-Version: 1.0

Main-Class: RUN.Stratego

Created-By: 1.4.1 (Sun Microsystems Inc.)

my main file is in the package RUN

i made the jar file like this

jar cvfm Stratego.jar manifest.mf RUN jess agent Images

RUN, jess, agent and Images are a used packages.

when i run the game with

java -jar Stratego.jar

the splash images shows and then i got a nullpointerexpection error for not finding the images.and i think the class that have the iconimages is not finding the Image folder. becouse i used "../images/pic.jpg"

i think its something with the classpathanyideas?

[790 byte] By [kimos_cs] at [2007-9-30 12:28:46]
# 1
how are u loading images?Are u using classloader? Use this.getClass().getResource("/Images/image.gif") for example
luisoft at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 2
only for the splash image i used a classloader. and for the other images i used "../images/image.jpg"
kimos_cs at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 3
so I think u must use classloader for other ones too
luisoft at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 4

i changed them still the same only the splash images show and then nullpointer. i dont understand why it run normaly if i compile and run from the commandline or from the IDE.

the splash image is using

image = new SplashScreenImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(i/images/splash.jpg)));

and the other are using:

images[1] = new ImageIcon(getClass().getResource("/images/Blue-Flag.jpg"));

any idea's?

kimos_cs at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 5

i changed everything to toolkit but i still get this error after the splash images is displayed

Uncaught error fetching image:

java.lang.NullPointerException

at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:99)

at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:108)

at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:248)

at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)

at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)

kimos_cs at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 6
how do you set the classpath of a jar in the manifest? i think this is the problem?
kimos_cs at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 7
are the images inside the jar file in the sub-directory "/images/" ?
Abuse at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 8
yes
kimos_cs at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 9
anyone? plz
kimos_cs at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 10
jar file access is case sensitive, check the case of the images you are trying to load.
Abuse at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...
# 11
Abuse thanks alot i didnt know it was case sensitive becouse it works fine with the IDE its running now thank again also thanks luisoft for trying to help
kimos_cs at 2007-7-4 16:01:17 > top of Java-index,Other Topics,Java Game Development...