Sign in to follow this  
getcarty

.jar problem

Recommended Posts

I've used the following tutorial to learn about programming with J2ME and now am trying to work out how to make .jar files: http://www.gamedev.net/reference/programming/features/j2me1/ the tutorial leaves me with 2 files: startup.java and startup.class which i then compile into a .jar archive using the jar.exe utility. This all works fine but when i try to install it to my sony k750i phone it just give me the error "operation failed". what am i doing wrong?

Share this post


Link to post
Share on other sites
OK, i've followed the tutorial and included the following manifest file:

MIDlet-Name: MyGame
MIDlet-Version: 1.0
MIDlet-Vendor: Martin
MIDlet-1: Startup
MIDlet-Jar-URL: MyGame.jar
MIDlet-Jar-Size: 100

and am still getting the same 'operation failed' error

any idea what i'm doing wrong now?

Share this post


Link to post
Share on other sites
So the file "startup.java" contains a class "startup" (with little s) without any package ? Otherwise you have to create the appropriate subdirectories for the package and place the classfile there.

Also don't confuse the manifest with the application descriptor, for instance:

Listing 1: MIDlet-Manifest

MIDlet-1: payment, payment.png, PaymentMIDlet
MIDlet-Name: payment
MIDlet-Vendor: Sun Microsystems
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-1.0

Listing 2: Java Application Descriptor (Jad)

MIDlet-Name: payment
MIDlet-Version: 1.0
MIDlet-Vendor: Sun Microsystems
MIDlet-Jar-URL: www.sun.com
MIDlet-Jar-Size: 3521
MIDlet-Data-Size: 513

(taken from here: http://www.linux-magazin.de/Artikel/ausgabe/2002/06/j2me/j2me.html?print=y)

The first one (manifest) must be put into the jar, the second one must be put into a text file ending in ".jad". The jad describes the jar, for instance the exact size of the jar (make sure that the size matches).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this