Skip to main content
GameDev.net gamedev.net
🔒 Locked

Using Sun One Mobile

Started by Moose6912 Jun 27, 2004 at 2:55 PM 1 replies 800+ views
Original Post
Moose6912
Moose6912
I've set up Sun One Mobile IDE for some J2ME work.I have no problems running my midlets.But how do i create a Jad/jar file so that i can transfer the files to my handphone and really test out my midlets?
Zaelsius
Zaelsius
From http://www.faqs.org/docs/ldev/0130091154_292.htm:


Creating jar Files
The jar utility is used to create Java-class archives. It can take multiple class files, compress these and put them into a single .jar file.

The syntax for using the jar utility is similar to the
tar program widely used on Linux and other UNIX systems. The following command creates a file myclasses.jar from two class file first.class and second.class.

jar cvf myclasses.jar first.class second.class
Zahlman
Zahlman
If you want to do it in the IDE:
(this is all from memory so I might have a couple details wrong; shouldn't be too hard to figure out)

- Right-click the icon for the Filesystem which contains your project.
- Select New... -> MIDlet Suite.
- A wizard pops up; specify your jar/jad name, MIDlet class (check "use existing class" if you have one already), icon, and emulator (optional).
- Right-click the icon for the MIDlet suite (this icon represents both JAR and JAD files); select "Edit Suite". Go to the other tab and add everything you need to the JAR.
IMPORTANT: if the icon for the MIDlet in the right column looks different from the usual icons, and the JAR is not working with weird errors at start-up, remove and re-add it. Actually, remove the midlet and icon and re-add them *anyway*; it's probably easier and safer ('tis what I do).
- In the Properties window for the MIDlet suite, go to Required; make sure that the "JAR name" matches the name you selected for the JAR. The easiest way is to just select the name, hit the "..." button, then hit Default.
- Right-click the suite again and select Update (and then Execute, if you want to run the Sun ONE Studio emulator).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.