Solved

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

Posted on 2004-04-08
10
2,461 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article I will describe how to setup a Cisco WLC 5508 to work with Apple's Bonjour protocol across VLANs.  I will also discuss using screen mirroring and Airplay on an AppleTV v3.  This article covers the wireless network only and requires m…
Working settings for French ISP Orange "Prêt à Surfer" SIM cards for data connections only. Can't be found anywhere else !
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…

759 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

20 Experts available now in Live!

Get 1:1 Help Now