Installing Java Wireless Toolkit on Linux
Introduction
Since Java ME SDK 3.0 is only available for Mac and Windows Linux users can either install Java Wireless Toolkit or try Eclipse Mobile Tools for Java. This document explains how to install Java Wireless Toolkit.
32 bit JDK installation
J2ME needs 32 bit Java platform. Download Java JDK for 32 bit Linux from here: J2SE Downloads
Click on Download button under JDK and accept license agreement. Download tgz archive file for 32 bit Linux (Linux x86). Current version is: jdk-7u9-linux-i586.tar.gz Save that file to Downloads directory. You need to login as root if you want to install JDK in a shared folder.
On Gnome desktop open Root Terminal window (Applications/Accessories/Root Terminal). Otherwise just open a terminal and login as root (su).
To install JDK in /opt folder follow these steps:
cd /opt
mkdir jdk
cd jdk
mkdir i586
cd i586
mv /home/<user>/Downloads/jdk-7u9-linux-i586.tar.gz .
tar xvf jdk-7u9-linux-i586.tar.gz
rm jdk-7u9-linux-i586.tar.gz
You should see the new directory: /opt/jdk/i586/jdk1.7.0_09
Fix library dependencies
Log in as root and check if you have apt-file utility installed.
If not you can install it with this command:
apt-get install apt-file
Java Wireless Toolkit depends on the following libraries:
- ibXpm (package libxpm-dev)
- libXt (package libxt-dev)
- libX11 (package libx11-dev)
- libICE (package libice-dev)
- libSM (package libsm-dev)
- libpthread (package libc6-dev)
- libm (package libc6-dev)
- libnsl (package libc6-dev)
- libstdc++6-dev
On older Linux systems (Lenny) you might also need to install ia32-libs package. Chances are you won't need to install all of those packages since some are installed automatically as a dependency. Install missing packages with apt-get command:
apt-get install libxpm-dev
Program apt-file is a useful tool for finding which package contains which files.
Use it to find packages containing libXext.so.6:
apt-file search libXext.so.6
Library libXext.so.6 is one of the few files that are required by 32 bit JDK libraries. On Debian Lenny 64 bit running above command yields the following results:
ia32-libs: /emul/ia32-linux/usr/lib/libXext.so.6
ia32-libs: /emul/ia32-linux/usr/lib/libXext.so.6.4.0
libxext6: /usr/lib/libXext.so.6
libxext6: /usr/lib/libXext.so.6.4.0
libxext6-dbg: /usr/lib/debug/usr/lib/libXext.so.6.4.0
If your system already has ia32-libs package installed you can proceed with Wireless Toolkit installation.
If not install that package with this command (as root):
apt-get install ia32-libs
Install Wireless Toolkit
Download WTK from this location: Java Wireless Toolkit 2.5.2_01
Scroll down until you see a blue Download button. Save sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh to Downloads folder.
You don't have to be logged in as root unless you want to install WTK in a shared directory. I chose /java folder as the WTK installation directory. Copy downloaded file to that folder and make it executable:
cd /java
mv /home/<user>/Downloads/sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh .
chmod u+x sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh
Run the installation file:
./sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh
When asked about the location of JDK enter the 32 bit JDK location (/opt/jdk/i586/jdk1.7.0_09/bin). When installation is finished you should see directory WTK2.5.2 inside /java folder.
Testing WTK installation
To test WTK installation execute these commands:
cd /java/WTK2.5.2/bin
./ktoolbar