?
Solved

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

Posted on 2004-04-08
10
Medium Priority
?
2,548 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

 

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
 
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 200 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

Bringing Advanced Authentication to the SMB Market

WatchGuard announces the acquisition of advanced authentication provider, Datablink, with one mission – to bring secure authentication to SMB, mid-market, and distributed enterprises with a cloud-based solution, ideal for resale via their established channel & MSSP community.

Question has a verified solution.

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

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…
DECT technology has become a popular standard for wireless voice communication. DECT devices are not likely to be affected by other electronic devices and signals because they operate in a separate frequency-band.
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…

770 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