• 14
• 12
• 9
• 10
• 9

# [java] JAR Portability

This topic is 4117 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

First, let me say this: I am new to this forum. Also, my first forum experience (ever) gave me an incorrect impression which I am still trying to correct (really quick response). Now: I have been making Java games for the past year almost. Since this summer (August 2006, approx) I have been working with the JAR file format. I can run them fine, but various people I have tried to show my games to have had difficulties running them. There are two situations/problems. One is this one person who was using Linux. I don't know, does Linux generally do JAR files correctly? The other is Windows (what I use); some people are getting "Could not find the main class. Program will exit." errors for no apparent reason. I can run it, and I can extract the manifest file, and I have verified that it is present and contains a main class. What could I be doing wrong? Also (question pertaining to where on the forum to put something, if anywhere), what about games that I have already made or done a lot on? Is there some sort of general board for posting accomplishments and projects? Or is this forum solely for people with questions and answers, not people with working stuff? In short, where (on this forum or elsewhere) can I showcase my stuff? Since this is pertinent, I will include the most recent JAR file I've created and the stuff that it goes with: http://www.esnips.com/doc/e2157da2-e83c-48f7-ab55-0031e053f509 I'm not posting the controls mainly because I don't know if this is the right place for it. If it is, I will go ahead.

##### Share on other sites
Linux does jar files fine. On most Linux systems you would need to run it from the command line, or using a shell script.

I could not run your game on XP.

Exception in thread "main" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0        at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)        at java.awt.image.BufferedImage.<init>(Unknown Source)        at hardpoint2.SuperImage.<init>(SuperImage.java:31)        at hardpoint2.SuperImage.forName(SuperImage.java:61)        at hardpoint2.HP2.<init>(HP2.java:62)        at hardpoint2.HP2.main(HP2.java:190)

I executed with the command: java -jar HardPoint2.jar

##### Share on other sites
I believe you may be missing some image files, or (more likely) if you have them they were not unzipped to the Images\ folder like they should have been.

Controls (I guess I will go ahead and post them):

UP = Accelerate
DOWN = Brakes
LEFT / RIGHT = Rotate
CTRL = Shoot
S = Afterburners (Extra speed while held)
J = Jump (Hold while over a gateway)
ENTER = Pause