FernUni / FB ET+IT / PRT / Andreas Bischoff

Andreas Bischoff HOMEPAGE

Andreas (C) Heike

Andreas WINDOWS CE PersonalJava stuff:

OLD: A page dedicated to my old toy a CE 2.0 based Ericsson MC 16! In 2003 I bought an used HP Jornada 680 palmtop device. My idea was to get a palmtop (keyboard!) device with Windows CE 2.11 to use Java (SUN's PersonalJava for wince 2.11) and a lot of Reiner Keuchels Windows CE ports of UNIX software. I've expected a little bit more stability than the older wince 2.0. A least to get a dynamic IP via DHCP doesn't require a reset anymore ;-) And the Jornada 680 hardware was improved compared with my old Ericsson MC16 (=HP360lx), the reset button (you have to use it often ;-) is now located near the keyboard.


Update: All the software described here works on a JVC MP-C33 (JVC-Victor Interlink MP-C303 ) too! (hpc2000 == wince 3.0 mips) my_JVC_MP-C33

My PersonalJava experiences

SUN Microsystems has released a Personal Java edition for WindowsCE. Since it should be compatible to Java 1.1.6 it is easy to use Java software on a wince 2.11 device. But after some tests with different Java-applets I've discovered some little problems. (Code once debug everywhere ;-)

UPDATE: Obviously Sun has decided to discontinue the free distribution of the PersonalJava JRE-binary for WinCE. (Why????) ) Since december 2003 the binaries are not available any more!  See the archived PersonalJava page at archive.org. But unfortunately you will not be able to download the binary there.  KaffeCE may be the last option for now.UPDATE 2008: Today I would highly recommend to use the great free and open source mysaifu JVM for Windows CE, PocketPC and Windows Mobile (WM2003, WM5 and WM6)!
UPDATE: At least for mips (pjavawince.mips.CAB) and arm (pjavawince.arm.CAB) CPU's I've found an alternative download location. UPDATE: Another location with mips, sh3, sh4 and arm binaries.

  1. If you try to run an applet in appletviewer mode of pjava.exe ( pjava -file "xyz.html") the applet is not allowed to open a network connection. You have to modify the applet to an application to use the net.
  2. The method java.io.inputstream.available() throws everytime an IOException regardless if a byte was available or not, I don't know if this is a problem with my device or a general PersonalJava problem. To realize nonblocking IO just read one byte at a time in a thread.
  3. There are some problems with AWT event, especially mousepressed() mousereleased() and mouseclicked() events might be a problem, use them with care.
  4. Obviously the PersonalJava VM has a problem with the "." (dot based classpath notation) in the Manifest file. Just replace the doted Notation e.g. "Main-Class: nmap.Application1" with "Main-Class: nmap/Application1" (remember " jar -mcvf mainClass.txt XXX.jar"  creates a Manifest, see the docs). With this tiny modification for instance Carlos Calafate's simple implementation in Java of the NMAP tool (don't expect to much ;-) , the and the JCraft's !great! WeirdX-server (under GPL) (a pure Java 1.1 X-Windows Server!!)  and the MindTerm SSH2-Java client are working on my Jornada. Some of the applications will run on PocketPC (PPC2000, PPC2002 and maybe on PPC2003 Windows Mobile 2003) devices too. (Hotjava will NOT, obviously PPC lacks some DLLs to support all features of the java AWT UPDATE: It works too, see below ;-).
  5. Some of the Applications, especially Hotjava, have problems with PersonalJava installed on memory cards, maybe only a local installation in /program files/java is supported.

Some interesting information about on-device compiling
.......to be continued....

JabberApplet as application for wince

To use the wonderful Jabber-Applet (what is jabber?) on my wince device I have modified it to a java application. Also problems with java.io.inputstream.available() and the mouse events are solved. The window size was modified to fit the limited screen size of the handheld device. I have created two versions, one with the standard jabber-digest authentication (secure, password is encrypted) and a version with plain-text authentication (which normally not works with JabberApplet) which is useful if your Jabber-server uses plain-text authentication only. (e.g. for extending Jabber authentication using xdb_auth/check ) Both versions are also still usable as Applets and are platform independent! On the wince device (with installed pjava runtime) just doubleclick the jar-archive! (It works on PPC devices [at least IPAQ 3630 with PPC2002 ROM upgrade and Trium Mondo] too!) On other platforms just start the application with "java -jar JabberApplet4.jar" or embed the jar in a html-page on your web server.
JabberApplet digest-authentication (secure) JabberApplet plain-text authentication (for xdb_auth/check )
JabberApplet5.jar JabberApplet4.jar
Jabber_Applet_Source.zip Jabber_Applet_Source2.zip

HotJava (an old Java based webbrowser) on Windows CE:

NEW: THE EASY WAY: I've created an install script which does the creation of a suitable browser2.jar for Windows CE automatically! (README.TXT)

Get the original HotJava web browser from Sun, select the Windows or Solaris version, install it on your Sun or your PC, search the browser.jar (on a windows PC under \programm files\hotjava). Unpack it with  jar -xvf (you need an installed JDK to use the jar command at the console prompt), add OrientableFlowLayout.class and modificate the MANIFEST. Pack it in a new jar with jar -mcvf mainClass.txtbrowser2.jar blablabla(all the directories). Transfer it to the wince device, don't forget the properties file below.

With the mentioned modification of the MANIFEST.MF file and a suitable properties ( for JVC MP-C33 [JVC-Victor Interlink MP-C303 this properties file ]) file located in my \Program Files\Java\.hotjava (the dot is NOT a typo! If you are unable to create this directory with the explorer use the "tascal-filer" [a freeware explorer replacement] instead) and an additional Class sun/awt/OrientableFlowLayout.class
(put it also into the jar file!) finally hotjava runs on my Jornada 680. Java-applets as far they are consisting of only one class file (not with an archive tag!) will run too!
Please note that personaljava must be installed in /program files/java to avoid problems.

UPDATE: Hotjava works on PPC (Dell Axim, Windows Mobile 2003) with the CrEme 3.26 Personaljava VM (use this properties file, copy it to the /.hotjava directory) too!

A pure Java X-Server for personaljava:

The JCraft's !great! WeirdX-server (under GPL) (a pure Java 1.1 X-Windows Server!!)  works on my Jornada (with small xclients like xterm eyes etc.)! Just extract the jar archive, and create a new jar with the modified Manifest (replace dots with slashes)!

My  weirdx props file for the Jornada, it must be copied into the config directory relative to the weirdx.jar.  The best idea is to copy the modified weirdx.jar to \Progam Files\Java\weirdX and create a config dir:   \Progam Files\Java\weirdX\config for the probs file there.

To replace the MainClass dots with slashes:

1. Extract the jar file:

    jar -xvf weirdX.jar

2. Create a new file mainClass_weirdX.txt

3. Replace the props file

4. Create a new jar with the new MainClass:
    jar -mcvf mainClass_weirdX.txt   weirdX2.jar com/ probs

That's all! Enjoy

(The windowmanager used in this example is the "swm".)

Since WeirdX was released under GPL I am able to host a preconfigured jar file for your Jornada680. The included probs file sets xhost + , this is not secure (but works instantly)! The probs file set the display number to 2 on the client machine, so you have to

export DISPLAY=[yourCEMachineName_or_IP]:2.0

before you start any X applications.

My modified weirdx.jar

Have fun.

The MindTerm SSH2 client for personaljava:

The MindTerm SSH2 client (a pure Java 1.1 SSH client with graphical sftp client)  works on my Jornada ! Just extract the jar archive, and create a new jar with a modified Manifest file (replace dots with slashes)! I've done this with version MindTerm_2.3.1 but it should work with newer version too.

To replace the MainClass dots with slashes:

1. Extract the jar file:

    jar -xvf mindterm.jar

2. Create a new file MainClass_mindterm.txt

3. Create a new jar with the new MainClass:
    jar -mcvf MainClass_mindterm.txt   mindtermCE.jar  com/* defaults/* netscape/*
    Transfer it to the wince device, store it were you like.

4. Create the directories \Progam Files\Java\mindter and \Progam Files\Java\mindterm\hostkeys on the wince device.
    ( \Progamme\Java\mindter  for wince german edition etc.)

5. Start the application with a doubleclick

6. Adjust the terminal-settings to fit the window size:

The famous links browser running inside a ssh session:

Mindterm has also a nice graphical sftp client:

There are still problems with some menus, they don'nt fit the limited screen size, but if you toggle the setting for the taskbar to auto hide and back, at least the title bar will appear, and you are able to close the popup.

That's all! Enjoy

Personaljava Java comm API for wince sh3:

To do some programming of serial interface of the Jornada with Java you need at least Java comm classes and a binary dll (JNI Java Native Interface).
Michal Hobot has ported the Java communication API from RXTX site ( http://www.rxtx.org ) to wince. I've created a windows CE  sh3 binary from his sources.
An IPAQ binary is available on his site. His ARM binary is still working with XSCALE based WinCE 5.0 (Windows Mobile, WM5) devices (Thx for testing to Markus Gasser).

Again you have to copy the proper java.comm.properties  to the \Progam Files\Java\ directory.
I use the comm API for an own GPS project together with the nice Java Chaeron GPS Library.

Have fun

Have fun

( for the bots: PersonalJava java.io.inputstream.available() jabber client jabberapplet xdb_auth_cpile WINCE 2.11 SH3 HP Jornada 680 freeware open source free software HPC PPC PDA )