simple program error when it runs

Discussion in 'Java' started by jack, Dec 2, 2005.

  1. jack

    jack Guest

    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
     
    jack, Dec 2, 2005
    #1
    1. Advertising

  2. jack

    tiewknvc9 Guest

    You may need to install the java virtual machine onto the device.
    Sun.com should have one listed close to the MIDP library.
     
    tiewknvc9, Dec 2, 2005
    #2
    1. Advertising

  3. jack

    jack Guest

    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
     
    jack, Dec 3, 2005
    #3
  4. jack

    Chris Smith Guest

    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
     
    Chris Smith, Dec 3, 2005
    #4
  5. jack

    jack Guest

    i have ide for developement
     
    jack, Dec 3, 2005
    #5
  6. jack

    yemen_eagle

    Joined:
    Apr 8, 2008
    Messages:
    1
    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: Apr 8, 2008
    yemen_eagle, Apr 8, 2008
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabor
    Replies:
    3
    Views:
    647
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. javaBeginner
    Replies:
    2
    Views:
    371
    Michiel Salters
    Jul 4, 2003
  3. Replies:
    14
    Views:
    549
    Karl Heinz Buchegger
    Nov 2, 2005
  4. RichardOnRails
    Replies:
    3
    Views:
    138
    RichardOnRails
    Jul 21, 2008
  5. Suresh Govindachar

    Simple code runs on linux, but not on windows -- why?

    Suresh Govindachar, Feb 21, 2004, in forum: Perl Misc
    Replies:
    20
    Views:
    301
    Tassilo v. Parseval
    Feb 23, 2004
Loading...

Share This Page