Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > simple program error when it runs

Reply
Thread Tools

simple program error when it runs

 
 
jack
Guest
Posts: n/a
 
      12-02-2005
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

 
Reply With Quote
 
 
 
 
tiewknvc9
Guest
Posts: n/a
 
      12-02-2005
You may need to install the java virtual machine onto the device.
Sun.com should have one listed close to the MIDP library.

 
Reply With Quote
 
 
 
 
jack
Guest
Posts: n/a
 
      12-03-2005
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

 
Reply With Quote
 
Chris Smith
Guest
Posts: n/a
 
      12-03-2005
jack <> wrote:
> 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
 
Reply With Quote
 
jack
Guest
Posts: n/a
 
      12-03-2005
i have ide for developement

 
Reply With Quote
 
yemen_eagle yemen_eagle is offline
Junior Member
Join Date: Apr 2008
Posts: 1
 
      04-08-2008
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 by yemen_eagle; 04-08-2008 at 08:27 PM..
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple program with a simple(?) error -- what's wrong? RichardOnRails Ruby 3 07-21-2008 01:26 PM
Simple simple program error...please help tasheeta@gmail.com C++ 14 11-02-2005 12:52 PM
Simple code runs on linux, but not on windows -- why? Suresh Govindachar Perl Misc 20 02-23-2004 07:04 AM
trace enabled, get app. error, doesn't enabled, on runs without error Gabor ASP .Net 3 08-26-2003 09:54 AM
Simple Program Laucher Which Runs Off Of Cd javaBeginner C++ 2 07-04-2003 12:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57