simple program error when it runs

J

jack

hi all
have jus tbrought developement kit for java mobile developement.
for sony erricson(p900 model mobile)
Im trying to create my first simple application with the help of the
example in the documentation installed with toolkit.
the code compiles properly but when try to run on the emulator
it gives the below error

'===========================================
Unable to create MIDlet TinyMIDIet
java.lang.ClassNotFoundException: TinyMIDIet
at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
at com.sun.midp.midlet.Selector.run(+22)
'===========================================
below is my code which is just simple one
'===========================================


import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;

public class TinyMIDlet
extends MIDlet

implements CommandListener
{
public void startApp()
{
Display display = Display.getDisplay(this);
Form mainForm = new Form("TinyMIDlet");
mainForm.append("Welcome to the world of MIDlets!");
Command exitCommand = new Command("Exit", Command.EXIT, 0);
mainForm.addCommand(exitCommand);
mainForm.setCommandListener(this);
display.setCurrent(mainForm);
}
public void pauseApp () {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s) {
if (c.getCommandType() == Command.EXIT)
notifyDestroyed();
}
}



'===========================================
please do help me in this i have tryed a lot to find out whats wrong in
this code but unable to solve it please do reply as the is my first
application

Awaitng for reply
Thanks for the reply
 
T

tiewknvc9

You may need to install the java virtual machine onto the device.
Sun.com should have one listed close to the MIDP library.
 
J

jack

Thanks for reply
i have already installed this . any way if i want to check this
whethere this is already installed in this pc how should i check it
im not a java programmer working in vb6 language .. but know just
little bit of java .. have learned long time back


Thanks once again

Needed help
 
C

Chris Smith

jack said:
the code compiles properly but when try to run on the emulator
it gives the below error

'===========================================
Unable to create MIDlet TinyMIDIet
java.lang.ClassNotFoundException: TinyMIDIet
at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
at com.sun.midp.midlet.Selector.run(+22)

The emulator needs to be run differently. How are you launching it now:
from within a tool, or from the command line? What else can you tell
us, particularly about the classpath if you've come across that term?

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Joined
Apr 8, 2008
Messages
1
Reaction score
0
java.lang.ClassNotFoundException

open the WTK (Wireless ToolKit)
open ur project
just go to setting menu>Midlet

there u will find the following fields that are editable:
midlet name field, midlet icon field, and midlet class field(which is the classpath and there's your problem)

you have to specify class path again in that loaction by clicking Edit at the bottom of the window.

suppose your main midlet is in package Greeting and ur midlet class name is TinyMIDlet

then u have to specify same in midlet class field as

Greeting.TinyMIDlet, and don't forget the dot(.) here
NOTE : if there is no package declared in the source file, just ignore the name and write just your midlet class name..
i hope this will help u and update me if there is any difficulty.:)
Peace.
sakr232000 at yahoo dot co dot in
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top