×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    1

    Error: java.lang.classnotfoundexception:midlet (pls help me on this)

    when i am running the program in a simulator
    this error occurs java.lang.classnotfoundexception:midlet

    code:

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

    public class BluetoothMidlet extends MIDlet implements CommandListener {

    private Display display;
    private Command exit;
    LocalDevice local;
    Alert a;

    public BluetoothMidlet() {

    display = Display.getDisplay(this);
    exit = new Command("Exit",Command.EXIT, 0);
    a = new Alert("Local Device");
    a.addCommand(exit);
    a.setCommandListener(this);

    }

    public void startApp() {

    try {

    // Retrieve the local Bluetooth device object
    local = LocalDevice.getLocalDevice();

    // Retrieve the Bluetooth address of the local device
    String address = local.getBluetoothAddress();

    // Retrieve the name of the local Bluetooth device
    String name = local.getFriendlyName();
    System.out.println(address + name);
    a.setString("Address is"+address+" Name is "+name);
    display.setCurrent(a);

    } catch(Exception e) {
    e.printStackTrace();
    }
    }

    public void pauseApp() {}

    public void destroyApp(boolean unconditional) {}

    public void commandAction(Command c,Displayable d) {

    if(c == exit) {
    notifyDestroyed();
    destroyApp(true);
    }

    }
    }

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Error: java.lang.classnotfoundexception:midlet (pls help me on this)

    Quote Originally Posted by wintereclipse View Post
    java.lang.classnotfoundexception:midlet
    What is the precise message? Does it say "midlet", "MIDlet", "Midlet", etc? It's a class name, so case is important.

    This is nothing to do with the code. Chances are, you have the incorrect MIDlet class name set up in your project properties (application descriptor), and you have "midlet" (or whatever the error says) when it should say "BluetoothMidlet" (your class).

    Graham.

  3. #3
    Regular Contributor
    Join Date
    May 2007
    Location
    India
    Posts
    208

    Re: Error: java.lang.classnotfoundexception:midlet (pls help me on this)

    using standard J2ME WTK or any IDE? How are you compiling the code - using any ANT file or so?

Similar Threads

  1. How To Implement equalizers in symbian C++..Pls help
    By upendersolanki in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2008-02-12, 16:48
  2. Replies: 15
    Last Post: 2006-08-28, 13:57
  3. pls help
    By viraj_turakhia in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-12-13, 08:33
  4. pls help me pls..... (everybody read this).....need it urgently
    By Never_Die in forum Bluetooth Technology
    Replies: 0
    Last Post: 2004-11-30, 07:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×