Results 1 to 3 of 3
  1. #1
    Nicsoft is offline Member
    Join Date
    Feb 2009
    Posts
    2
    Rep Power
    0

    Default JAVA ME - Problems compiling and running in Eclipse

    Hello,

    I am new to Java ME and I am trying to run a copied HelloMIDlet application. I am getting following error when I am trying to run the application:

    Java Code:
    Running with storage root C:\Users\Niklas\j2mewtk\2.5.2\appdb\MediaControlSkin
    Running with locale: Swedish_Sweden.1252
    Running in the identified_third_party security domain
    java.lang.NullPointerException
    	at javax.microedition.lcdui.Item.addCommandImpl(+11)
    	at javax.microedition.lcdui.StringItem.addCommandImpl(+11)
    	at javax.microedition.lcdui.Item.addCommand(+11)
    	at HelloMIDlet.<init>(+99)
    	at java.lang.Class.runCustomCode(+0)
    	at com.sun.midp.midlet.MIDletState.createMIDlet(+34)
    	at com.sun.midp.midlet.Scheduler.schedule(+52)
    	at com.sun.midp.main.Main.runLocalClass(+28)
    	at com.sun.midp.main.Main.main(+80)
    Execution completed.
    3415817 bytecodes executed
    17 thread switches
    1667 classes in the system (including system classes)
    17760 dynamic objects allocated (533540 bytes)
    2 garbage collections (459436 bytes collected)
    And the applicaiton:

    Java Code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    
    public class HelloMIDlet extends MIDlet 
           implements CommandListener {
      // The exit command
      private Command exitCommand; 
      // The display for this MIDlet
      private Display display;    
      // create a ticker
      private Ticker hi = new Ticker("J2ME is cool"); 
    
      public HelloMIDlet() {
        display = Display.getDisplay(this);
        exitCommand = new Command("Exit", Command.SCREEN, 2);
      }
    
      public void startApp() {
        TextBox t = new TextBox("Hello MIDlet", 
                    "Wireless Internet", 256, 0);
    
        t.addCommand(exitCommand);
        t.setCommandListener(this);
        t.setTicker(hi); // set the ticker
        display.setCurrent(t);
      }
      public void pauseApp() { }
      public void destroyApp(boolean unconditional) { }
      public void commandAction(Command c, Displayable s) {
        if (c == exitCommand) {
          destroyApp(false);
          notifyDestroyed();
        }
      }
    }
    I did try to remove as much code as possible still being able to compile it. Exactly the same type of error was presented still...

    I have another MIDlet in the same projects that works fine.

    What is the problem?

    Thank you in advance!

    Best Regards,
    Niklas

  2. #2
    salwa.imag2 is offline Member
    Join Date
    Mar 2009
    Posts
    1
    Rep Power
    0

    Default

    hi,
    I'm using YICES with eclipse it's a theory prouver, when i'm runing the project there is error in runing it's "lunch failed no file binary", please help me :(

  3. #3
    Nicsoft is offline Member
    Join Date
    Feb 2009
    Posts
    2
    Rep Power
    0

    Default

    You should create a new thread when posting a new question!

Similar Threads

  1. Equinox problems running on Eclipse 3.4
    By jguerra in forum Eclipse
    Replies: 0
    Last Post: 09-05-2008, 03:34 PM
  2. Running eclipse java project on command prompt
    By hnmapara in forum New To Java
    Replies: 1
    Last Post: 07-09-2008, 09:29 AM
  3. Compiling and running code in runtime
    By tim in forum New To Java
    Replies: 4
    Last Post: 01-27-2008, 07:58 PM
  4. Importing / compiling and running with .jar package
    By splinter64uk in forum New To Java
    Replies: 1
    Last Post: 12-05-2007, 03:47 AM
  5. problems when compiling
    By valery in forum New To Java
    Replies: 2
    Last Post: 07-25-2007, 08:35 PM

Posting Permissions

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