The following assumes you're already running Familiar Linux on your iPAQ hx4700. I obtained Familiar from http://sdgsystems.com/pub/ipaq/hx4700/starterkit/current, but you may know of other sources.
The work documented here was required due to JBlueZ's dependency on JNI; a shared library is used to interface between the JVM and the native BlueZ library. This shared library ties JBlueZ to the x86 Linux platform, for which is was designed. I wanted to use JBlueZ on my Linux-enabled iPAQ instead.
Blackdown Java 1.3.1 is available for the iPAQ, if you download the arm distribution. For the sake of simplicity, I extracted this and placed it all under /usr/local/ on the iPAQ.
You need a compiler which can create binaries targetted for the appropriate platform. I downloaded the toolchain which is available at ftp://ftp.handhelds.org/projects/toolchain/ (namely, arm-linux-gcc-3.3.2.tar.bz2). As with Java, I extracted and placed all this into /usr/local/.
JBlueZ is designed to interface with the BlueZ stack incorporated into Linux. It can be downloaded via http://jbluez.sf.net/. Place this distribution somewhere convenient -- the only truly important parts are the contents of the bin/ directory (which contains the .so file which we will be generating). I worked under /tmp/, and will use this in any following examples.
For the compilation process, the libbluetooth libraries which reside on the iPAQ must be pulled onto your host machine. This is as simple as: mkdir /tmp/libbluetooth && scp root@ipaq:/lib/libbluetooth* /tmp/libbluetooth/
The JBlueZ sources require a little fixing, but not much at all. In the order I tackled them then:
With these modifications in place, it should be a simple case of compiling JBlueZ via make. This step should pass without failure -- the library has now been built. Now transfer the jbluez tree over to the iPAQ. The tree only takes up about 487.5KB of space.
For the sake of simplicity, and to reduce workload each time I run anything, I have the following script simply named "j" placed in /usr/local/bin/:
#!/bin/sh export CLASSPATH=$CLASSPATH:.:/tmp/jbluez/bin/jbluez.jar export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/jbluez/bin/ killall hciattach hciattach -S /etc/bluetooth/TIInit_3.2.26.bts ttyS1 texas 1> /dev/null 2>/dev/null java $1
My /etc/bluetooth/hcid.conf is largely unmodified, but I suspect it might prove useful to mirror my setup entirely for anybody else trying out JBlueZ on their iPAQ. My hcid.conf is available here.
With all this in place, it should be a matter of locating a JBlueZ application and running it:
# cd /tmp/jbluez/examples/inquiry/ # j Inquiry 2 devices found. 00:E:07:E3:26:D5 00:11:B1:07:A2:F1 #
If you don't fancy all that effort, feel free to download the outcome of my troubles here.