Setting up Netbeans for J2ME Development

I’m currently taking a class in mobile computing, and this was the week I decided to get my programming environment set up.  The Sun Java Wireless Toolkit is nice, but for someone used to the extra power of an IDE such as Netbeans or Eclipse, it can be a little underwhelming.  I personally am a Netbeans fan, so did some googling and set up my Netbeans for mobile development.  Getting things working wasn’t particularly difficult, but I did notice that it was hard to find all the necessary instruction in one place.  To remedy this I created this little how-to.  I hope this helpful to people trying to accomplish the same task.  Suggestions for improvement are welcome and encouraged.

  • Download the Sun Java Wireless Toolkit from http://java.sun.com/javame/downloads/index.jsp
  • In the terminal: CD to the directory where the file sun_java_wireless_toolkit-2_5_2-linux.bin was downloaded
  • Make the file executable: chmod 755 sun_java_wireless_toolkit-2_5_2-linux.bin
  • Run the executable: ./sun_java_wireless_toolkit-2_5_2-linux.bin
  • You may need to specify a path to the Java Interpreter.  For me the path was  /usr/lib/jvm/java-6-sun/bin/
  • You will need to tell the installer where to place the folder for the Toolkit.
  • Download the Netbeans 6.5 IDE from http://www.netbeans.org/  (You can choose to download a version which contains J2ME support, but I prefer to Download the Standard Edition and add the Mobility Pack later)
  • In the terminal: CD to the directory where the file netbeans-6.5-ml-javase-linux.sh was downloaded
  • Make the file executable: chmod 755 netbeans-6.5-ml-javase-linux.sh
  • Run the executable: ./netbeans-6.5-ml-javase-linux.sh
  • Follow the instuctions in the installer
  • Install the Netbeans Mobility Plugins by going to Tools –> Plugins –> Available Plugins and selecting the plugins in the Mobility catagory
  • Add a new platform by going to Tools –> Java Platforms, and clicking Add Platform, then select Java ME MIDP Platform Emulator, then click next and select the directory you installed the Sun Java Wireless Toolkit to.  For me this was /home/bill/WTK2.5.2
  • To test, go to File –> New Project –> Java ME –> Mobile Application, click next then name your project HelloWorld.  Be sure to uncheck the box that says Create Hello_Midlet
  • Go to File –> New File –> MIDP –> MIDlet, click next and name your file HelloWorldMidlet.
  • Delete all the text in the editor and replace with this
  • Build and run the project.
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.