Solved

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

Posted on 2004-04-08
10
2,516 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
Now Available: Firebox Cloud for AWS and FireboxV

Firebox Cloud brings the protection of WatchGuard’s leading Firebox UTM appliances to public cloud environments. It enables organizations to extend their security perimeter to protect business-critical assets in Amazon Web Services (AWS).

 

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

Now Available: Firebox Cloud for AWS and FireboxV

Firebox Cloud brings the protection of WatchGuard’s leading Firebox UTM appliances to public cloud environments. It enables organizations to extend their security perimeter to protect business-critical assets in Amazon Web Services (AWS).

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSH access to a Cisco 3702 access point 2 90
DNS with WiFi Network 5 81
Unifi AP 4 93
WLC 5508 controller configuration 4 109
With the purchase of CloudCommand by Comcast customers are left in a bind as subscriptions expire and render the AP's disabled. The following will explain how to flash your Ubiquiti AP's with CloudCommand firmware back to Ubiquiti firmware. HOWTO…
Multi-source agreements are important because they set standards that all manufacturers should follow to ensure that devices are compatible with multiple vendors. The multi-source agreement (MSA) is an agreement that establishes how multiple vendors…
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…

733 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