One of the classes I’m currently teaching involves group programming of a game for (old) mobile phones – this is based on J2ME, and the standard setup for the class uses Sun’s (now Oracle’s) wireless toolkit WTK v2.5.2. This is Java-based technology so in principle should work cross-platform. However, the WTK is only available for 32-bit builds. This means that to use this, you’ll need the 32-bit Java Development Kit (JDK) installed. Now since most modern machines are 64-bit, and since the standard lab setup is 64-bit Ubuntu, one needs to jump through a few hoops to get this to work.
I’m writing this to document the process. This is based on the work of a current BSc student who wrote a blog post about this. The only major change to his process is the installation of the 32-bit JDK rather than the JRE as a 32-bit JDK is actually needed on our current setup. So here goes:
- Download the Linux x86 (32-bit) JDK (get the bin, not the rpm).
- Install this to a local folder; I’d recommend installing as root into /opt/jdk1.6.0_31 (this is the default folder if you run this in /opt)
- Download the Linux WTK 2.5.2 (get the bin.sh, not the windows exe).
- Install this to a local folder; I’d recommend installing as root into /opt/wtk. While this is installing you need to specify the location of the JDK environment; if you followed the above, this is in /opt/jdk1.6.0_31/bin. This will set the necessary javapathtowtk path for the emulator and ktoolbar shell scripts in /opt/wtk/bin; you can verify that this is so with a text editor.
- That’s it, you should be done with the install. To make this work under Eclipse, after installing EclipseME (from http://www.eclipseme.org/updates directly in Eclipse) you need to set the WTK root path to /opt/wtk.