06 July 2009

Preparing 64-bit Ubuntu for J2ME Development

J2ME development on a 64-bit OS is unfortunately not as programmer friendly as it should be right now. Sun's Wireless Toolkit for CLDC currently only supports 32-bit development, so we're stuck trying to get 32-bit JDK up on a 64-bit Ubuntu.

The good news is there's a Ubuntu package to help us along the way; or at least part of the way. From Ubuntu's package archives, we'll need to install java-package, then proceed with installing the JDK which we'll need to download ourselves from Sun's website.

~$ sudo apt-get install java-package
~$ DEB_BUILD_GNU_TYPE=i486-linux-gnu DEB_BUILD_ARCH=i386 fakeroot make-jpkg
jdk-6u14-linux-i586.bin
~$ sudo dpkg -i sun-j2sdk1.6_1.6.0+update14_amd64.deb

The recommended IDE for J2ME development seems to be either Eclipse IDE or NetBeans, but I prefer a more minimalist approach so I'm using vim. It's not an easy editor to learn, though. There's plenty of resources online on how to setup Eclipse or NetBeans so I'll not delve into them here.

Next up would be to prepare Sun's Wireless Toolkit for CLDC (WTK). The current version is 3.0 but that seems to come bundled with J2ME 3.0 which means it's Windows-only (for now), so we'll be using 2.5.2 for our purposes.

~$ sudo chmod +x sun_java_wireless_toolkit-2_5_2-linux.bin
~$ ./sun_java_wireless_toolkit-2_5_2-linux.bin

Follow the installer's instructions. I chose to install into a folder in my Home folder. I've never liked contaminating my OS with unofficial/unsupported software, so I try to avoid installing anything into the system as much as possible. Over the years, I've come to appreciate the value of less. WTK runs perfectly fine wherever you place it, so there's no worries there. Afterwards, I
simply write a simple script to launch the toolkit for me so I don't have to open up a terminal for it everytime I need it. Just fire up vim and type the following:

#!/bin/sh

~/WTK2.5.2/bin/ktoolbar

I saved it as 'ktoolbar' then made it executable like so:

~$ sudo chmod +x ktoolbar

Double click to run it. Now you're ready to make some midlets. Nokia has a nice and short webinar that you can also download as a pdf for offline consumption. At the time of this writing, I've only just completed up to the sample first midlet myself and I find the webinar to be quite clear and easy to follow.

Resources:

- 32-bit JDK on a 64-bit Ubuntu System
- Java SE Development Kit
- Sun Java Wireless Toolkit 2.5.2 for CLDC
- Java ME for Nokia Platforms E-learning

31 May 2009

Is there no end to all this?

The random hardlocks that started appearing on my comp since Gutsy/Hardy have gotten worse almost with every new Ubuntu release. Not to mention the recent upgrade to Jaunty had made my DVD burner disappear from the system.

In the end, the only solution was to format and do a clean installation of the system. My DVD burner's back, so I can finally move stuff out again. So far so good on the overall system stability front. I've switched to using ext4 as my filesystem of choice on the root filesystem. If everything turns out fine, I'll see what I need to do to get my 2nd hard drive converted as well...

12 May 2009

Quick fixes...

It seems that my earlier post on the printer issue was a known bug in Ubuntu. It's since been fixed and the update rolled out to the community. Too bad my DVD writer still isn't showing up...

02 May 2009

The printer that won't print

Seems like my "missing" DVD+/-RW isn't the only issue with Jaunty. My Samsung ML-1610 doesn't print neither. Based on what little clues my meagre skills allow me to notice, it seems like it's mainly a configuration issue rather than an actual bug in the driver.

Of course, if only I knew where to look to fix this one :-P

28 April 2009

Copying the entire contents of a file to system clipboard using Vim

I've been collecting MouseHunt journal logs and putting them into pooflinger's Log Summariser. Since I try to use Vim as my text editor as much as possible, it's become quite annoying when time comes to copy the contents of the file to be pasted onto the page.

Hence, tonight I've gone and found myself the way to copy the whole shebang onto GNOME's system clipboard so I can just paste the journal logs instead of opening the file in another (GUI) text editor for the purpose.

Here's the command to copy the entire file contents from Vim to the clipboard:


:%y+

Simple, no? Learn something new every now and then ;-)

The link provided even lists other variations that might come in handy someday.