
Java on the HP Jornada 720
This is very rough (as is the rest of my site), but I wanted to get it
up online as soon as I could so other Jornada 720 users could start using
their Jornadas to compile and run Java apps and so perspective Jornada
buyers would see that in addition to being the best little PDA on the
market, the 720 is also a mini-computer on which you can compile and learn
Java.
The impetus for this project was that I began taking a class to learn
Java at the local university. I wanted to have Java with me when I was
commuting so I could try things out. I also wanted to be able to follow
along in class and actually attempt examples along with the professor. I
had settled for quite a while on just having a copy of Bruce Eckel's
wonderful book "Thinking In Java" (http://www.mindview.net/Books/TIJ/)
on my Jornada and just using the Jornada to read the book. That was until
I came across a site describing how to compile Java on a Psion 5mx and
another post on Deja from a user who claimed to compile Java on an HP
Jornada 680.
So I started working with the Psion site (http://www.hasiland.com/javaonepoc/javac.html)
and using the instructions there I was able to get Javac running on my
720. Much thanks to Frank Bodmann for coming up with this in the first
place for Psion. I simply followed his lead and was able to get it running
on mine. And here's how I did it.
- Step 1: Install Personal Java for Windows CE for the ARM
processor. This can be found on Sun's site if you register (it's free)
for a login on their site. http://developer.java.sun.com/developer/earlyAccess/personaljava/.
I installed it on my compact flash card, so in my pictures and examples
the path to the Personal Java install will be "\Storage Card\Program
Files\Java". One caveat to this install is that it doesn't detect the
720 as an HPC. So after installing Personal Java on the 720 you need to
open it using Winzip or another archive program and extract the files
named "pjava.002" and "wcecom~1.003". In the Personal Java install
folder rename pjava.exe to pjava.exe.old and wcecompat.dll to
wcecompat.dll.old. Finally, copy wcecom~1.003 and pjava.002 into the
"\bin" directory of your Java install and rename them wceCompat.dll and
pjava.exe respectively. Next, use Sun's directions and samples to ensure
the Personal Java is working. This can be a bit tricky and usually works
best from the command line.
- Step 2: Create a folder to store your class files and .java
source files. I chose \Classes because that meant less to type on the
command line.
- Step 3: Following the directions on Mr. Bodmann's
site I installed the JDK 1.1 on my desktop.
Then I used winzip to open lib\classes.zip and extracted the following
files and folders.
sun/tools/asm/*.class sun/tools/java/*.class
sun/tools/javac/*.class
sun/tools/javac/resources/javac.properties sun/tools/tree/*.class
I zipped these into an archive named javac.zip which I then
renamed javac.jar and copied to the lib directory of my Personal
Java install on my Jornada 720. In my case this was \Storage
Card\Program Files\Java\lib.
- Step 4: Next I took the following classes from my JDK 1.1
install (in my case JDK 1.1.8)...
java/awt/*.class java/io/*.class java/lang/*.class java/net/*.class java/security/*.class java/text/*.class java/util/*.class
....and wrapped them up like above into a zip file named missing.zip
which I renamed missing.jar and placed in the lib directory of my
Personal Java install on my 720. Here is a picture of these .jar files
in that folder.
- Step 5: Next I created my own Javac.java wrapper source file
and compiled it on my desktop. You can download the source
and class
file here. I copied these into my "\Classes\" directory.
- Step 6: That's all there was to it. Now it was just a matter
of running Javac.class via Personal Java to compile a .java file. My
tactic in doing this has been to use a notepad product to write the
.java files, then to use Personal Java to compile and ChaiVM to actually
run the output. The reason being that ChaiVM is much more reliable right
now at console output. I use the command prompt (cmd.exe or just "cmd"
from the run prompt) to run Javac.java. To run it you need to run Javac
through the Personal Java virtual machine (pjava.exe) and include in the
classpath the .jar files we copied over from earlier. Look in the
pictures below for an example of what this command looks like at the
prompt.
Below are some more pictures, but please let me know if you have
any questions or tips on how to improve this obvious rough draft both of
the procedure and the directions.
The .jar files in their new home.
The source code for Javac.java.
A template file storing the long and difficult command that would
have to be typed into the command line each time if I didn't paste it.
Now I've pasted this command into my command prompt
window and I'm getting ready to use it to run "\Classes\Javac.class"
against "\Classes\HelloWorld.java".
Here we go compiling.
Here's what HelloWorld.java looked like.
Now we get ready to run it in ChaiVM by clicking "Browse" and
navigating to the "\Classes" directory to find "HelloWorld.class".
Now we run it and WOW, it works!
|