Solved

Set Netbeans and Eclipse up to run J2ME!!!!!!!!!!!!!!!!

Posted on 2004-04-08
10
2,479 Views
Last Modified: 2012-05-04
Hello, I am a real nweby with J2ME and I installed the J@ME wireless tool kit in Netbeans 3.6 and in Eclipse 3.0M8, but when I try to compile a simple program they don´t find the libraries.
Eclipse says that the import of javax.microedition cannot be resolved for the import
import javax.microedition.midlet.*;
and Netbeans says
Startup.java [1:1] package javax.microedition.midlet does not exist
import javax.microedition.midlet.*;

I need a step by step configure for BOTH of them (Eclipse and Netbens) to include this libraries!!!

Thank you very much
Rudi
0
Comment
Question by:idur
10 Comments
 
LVL 9

Expert Comment

by:OBCT
ID: 10796953
If you have the J2ME Wireless Toolkit that can run standalone, try to compile a basic MIDlet to see if there are any problems with the microedition packages.

E.g.

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

public class HelloWorld extends MIDlet implements CommandListener
{
    private Form      mainScreen;
    private TextField inputTxt;

    private static final Command exitCmd = new Command("Exit", Command.EXIT, 1);

    public HelloWorld()
    {
        inputTxt   = new TextField("Text Input", "HelloWorld!!!", 255, TextField.ANY);
        mainScreen = new Form("HelloWorld");
        mainScreen.setCommandListener(this);
        mainScreen.addCommand(exitCmd);
        mainScreen.append(inputTxt);
    }

    protected void startApp()
    {
        Display.getDisplay(this).setCurrent(mainScreen);
    }

    protected void pauseApp() { }

    protected void destroyApp(boolean unconditional)
    {
        notifyDestroyed();
    }

    public void commandAction(Command e, Displayable d)
    {
        destroyApp(false);
    }
}

Cheers

-OBCT
0
 

Author Comment

by:idur
ID: 10798328
I used Ktoolbar form Sun´s wireless toolkit and got the following messeges::


Creating project "exemplo"

Place Java source files in "C:\WTK21\apps\exemplo\src"

Place application resource files in "C:\WTK21\apps\exemplo\res"

Place application library files in "C:\WTK21\apps\exemplo\lib"

Settings updated

Project settings saved

Project settings saved

Building "exemplo"

Build complete

Running with storage root DefaultColorPhone

Unable to create MIDlet HelloWorld

java.lang.ClassNotFoundException: HelloWorld

      at com.sun.midp.midlet.MIDletState.createMIDlet(+14)

      at com.sun.midp.midlet.Selector.run(+22)
0
 
LVL 9

Expert Comment

by:OBCT
ID: 10798345
Make sure all your class files for the application are in  C:\WTK21\apps\exemplo\src
It sounds like that's the cause of the exception.
Have a look through the WTK's help documentation for more information on how to compile, run and package an MIDlet.
0
 

Author Comment

by:idur
ID: 10798413
For this example you told me to run, I just put the file HelloWorld.java in the src folder.... Is there any other class ???
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 9

Expert Comment

by:OBCT
ID: 10798438
>Is there any other class ???

No, there isn't.
Once your *.java files are in the 'src' directory, you can click 'build' in the WTK and it will compile your application.
If there are no errors in the java file and the compiling has finished...click "run" and your MIDlet app will be emulated in a mobile phone emulator.

0
 

Author Comment

by:idur
ID: 10798507
Well, that´s what I´ve done. I want now that Netbeans and Eclipse compile the j2me classes...
0
 
LVL 15

Accepted Solution

by:
jimmack earned 50 total points
ID: 10949741
You need to get Ant and the associated plug-in for Eclipse (if you don't already have it).  You should then get the Antenna extensions for Ant.  The docs should explain everything, but I've just posted an example at: http://www.experts-exchange.com/Programming/Wireless_Programming/Q_20971796.html

Ant: http://ant.apache.org/

Antenna: http://antenna.sourceforge.net/

(I don't know how to integrate Ant and Antenna into Netbeans.  I'm not familiar enough with the tool).
0
 

Expert Comment

by:debuchakrabarty
ID: 11350935
For using ANtenna with Netbeans you may find the discussion at http://jroller.com/page/debashish?anchor=using_antenna_with_netbeans helpful.
0

Featured Post

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

MAC Filtering: MAC filtering is like handing a list of names to a doorman. If someone comes to the door and mentions a name, this name is checked by the doorman on his list and granted or denied access by this. This means that if someone menti…
For Sennheiser, comfort, quality and security are high priority areas. This paper addresses the security of Bluetooth technology and the supplementary security that Sennheiser’s Contact Center and Office (CC&O) headsets provide.  
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now