Skip to main content

How to run my own class?

1 reply [Last post]
Joined: 2009-09-27

hello everyone.
there is an example runMidlet in phoneme, and give the commandline
./runMidlet_g -1 com.sun.midp.scriptutil.CommandLineInstaller I $1 $2
the class CommandLineInstaller can run. but when i run my own class as
./runMidlet_g -1 Test,error occur
java.lang.ClassNotFoundException: Test
- java.lang.Class.forName(), bci=0
- com.sun.midp.main.CldcMIDletLoader.newInstance(), bci=1
- com.sun.midp.midlet.MIDletStateHandler.createMIDlet(), bci=63
- com.sun.midp.midlet.MIDletStateHandler.createAndRegisterMIDlet(), bci=17
- com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=24
- com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=39
- com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=5
- com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=134
- com.sun.midp.main.MIDletSuiteLoader.main(), bci=12.

that's why,some one can help me? thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-01-03

Either you need to install the midlet with the midlet manager and use the correct
suite ID as a parameter to run the midlet. Or you package your midlet as a jar and
do something like this:

./runMidlet_g -classpathext Test.jar -1 Test

The com.sun.midp.scriptutil.CommandLineInstaller midlet is built into runMidlet_g.
Your midlet is not, that is why you need to add it to the classpath. Otherwise it
cannot find the class Test.