Jar does nothing!

Yes, another one of these threads, I am trying to export my program to jar in Eclipse 3.2.

I selected my project, and the package, and all of the resources within it. I export it to my desktop, and YES I DID include the Main class.

Ok, it seems to export to my desktop with no issues, I double click the jar file, and absolutely nothing happens. With a different program at least the window canvas opens up, but its black and displays no graphic images, and only the drawString's. What is going on!! I am having big time trouble exporting to jar, they need to make this easier!

[598 byte] By [DarkMortara] at [2007-11-26 16:29:39]
# 1
> they need to make this easier!It's not hard at all. There is probably an error in your code. Run it from the command prompt to see if there is.
CaptainMorgan08a at 2007-7-8 22:54:03 > top of Java-index,Desktop,Deploying...
# 2
How can there be an error? The code runs perfect! To me easy, is .exe in C/C++, id rather read files from directories instead of packing!!
DarkMortara at 2007-7-8 22:54:04 > top of Java-index,Desktop,Deploying...
# 3

Here is a screenshot. When I ran it through the command line, it says that it cant find one of my images, and it list the variables that i do system.out.printed, so it ran but it doesnt find my image, its funny because i exported EVERYTHING in the ide, and the images, and they are ALL checked! I have tried everything under the sun to make a jar that works, its like impossible or something! But my program works perfectly in the ide, with images and everything.

http://img101.imageshack.us/img101/3831/jarhelpyg6.png

Message was edited by:

DarkMortar

DarkMortara at 2007-7-8 22:54:04 > top of Java-index,Desktop,Deploying...
# 4

Ok, sorry for the triple post, but I know "why" it is doing this. It cant seem to find my graphical images. I have made jars for two other programs, and it has found those images and they worked. But my program does not work it doesnt find the reference, yes I use a resource loader.

public Graphic getGraphic(String ref, String type) {

// if we've already got the sprite in the cache

// then just return the existing version

if (graphics.get(ref) != null) {

return (Graphic) graphics.get(ref);

}

// otherwise, go away and grab the sprite from the resource

// loader

BufferedImage sourceImage = null;

try {

// The ClassLoader.getResource() ensures we get the sprite

// from the appropriate place, this helps with deploying the game

// with things like webstart. You could equally do a file look

// up here.

URL url = this.getClass().getClassLoader().getResource(ref);

if (url == null) {

fail("Can't find ref: "+ref);

}

// use ImageIO to read the image in

sourceImage = ImageIO.read(url);

} catch (IOException e) {

fail("Failed to load: "+ref);

}

// create an accelerated image of the right size to store our sprite in

GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();

/** Keenan's Renderer Mod */

if (type=="oGRAPHIC") {

image = gc.createCompatibleImage(sourceImage.getWidth(),

sourceImage.getHeight(),Transparency.OPAQUE);

}

else if (type=="tGRAPHIC") {

image = gc.createCompatibleImage(sourceImage.getWidth(),

sourceImage.getHeight(),Transparency.TRANSLUCENT);

}

// draw our source image into the accelerated image

image.getGraphics().drawImage(sourceImage,0,0,null);

// create a sprite, add it the cache then return it

Graphic graphic = new Graphic(image);

graphics.put(ref,graphic);

return graphic;

}

I have loaded my images like this:

if(TEXTURE == GRASSLAND) {

return GraphicStore.get().getGraphic(

"\\ART\\TERRAIN\\GRASSLAND\\hex_green.png","tGRAPHIC");

}

DarkMortara at 2007-7-8 22:54:04 > top of Java-index,Desktop,Deploying...