NetBeans and J2ME compilation on 64 bit Linux

Unfortunately, although you do get the Java SDK or Java Runtime in the 64 bit versions of Linux, you do not get the Sun Java Wireless Toolkit for the 64 bit versions of any Operating System.

When you compile programs witht the 64 bit Java SDK for J2ME / mobile phones, you will get errors like:
UnsatisfiedLinkError: WTK2.5.2/bin/sublime.so or related to the Architecture.

To overcome this error, you need to do the following:

  1. Download and install the 32 bit version of the Java SDK
  2. Download and install the WTK2.5.2 (sun java wireless toolkit)
  3. Download Netbeans (all platforms) from the netbeans web site.
  4. Install Netbeans.
  5. NetBeans should refer to the 32 bit version of Java you installed earlier.

Install them. After that, do the following actions in NetBeans:

  1. Start NetBeans
  2. Click on Tools -> Java Platforms
  3. Select the Sun Java(TM) Wireless Toolkit in the Platforms panel.
  4. Click on the Remove button to remove it.
  5. Click on Add Platform… button to point to the WTK2.5.2 that you installed separately and not the one within the NetBeans folder.
  6. If NetBeans refers to the JDK within the NetBeans folder, remove JDK too, and click on Add Platform… button to point to the 32 bit JDK version you installed separately.

Now you should be able to use NetBeans to run the Demo programs for J2ME and see they compile without the error.