Compiling java on your Psion 5mx

This page is intended to provide all the information you need to start using you Psion 5mx to compile code. It assumes that you know how to copy files to and from our Psion from you PC and that you know what you are doing with, or at least the basics of Java.

Firstly before I start I would like to that the people at Symbian for their help through the java news groups and to John McAleely for moral support and confirmation of mine and other's mistakes.

There are two simple and basic things you need, firstly you will have to change your classes.zip file that is found on you Psion. To be on the safe side rename you classes.zip, found in /system/java/lib of the drive you installed Java on to something like classes.original. You can now replace this with a more comprehensive verion I've created by taking the 1.1.8 sdk and merging in Psion's classes.zip. The reason why you need to do this is because some of the basic classes in the standard classes.zip are in fact pre-loaded with Psion's JVM. This means that some of the basic classes like java.lang.Object are not in Psion's classes.zip but in their JVM in the form of probably dlls.

classes.zip sorry, http download only, roughly 2 meg.

Please be aware that I am not supposed to distribute Sun's classes.zip, I will probably get told off soon. You download this at your own risk. If you want to create your own classes.zip then you will need to read the instructions on Frank Bodmann's page and pay a visit to Sun's official Java 1.1.8 site.

I have deleted just one thing out of this classes.zip file in order to keep the size down to a reasonable 2 meg and that is all of the sun.io.*. If your code includes these files you will need to add them to the zip file.

Now just try to run something to check that all is working before going on to the last bit...

You now have two choices although I recommend both options. Firstly you can download Symbian's eshell.exe to run a dos like command line on your Psion. Make sure you get the latest version, re-published on the 8th June, there were problems with the earlier version as well as a more recent version. At the time of writing the date of the working eshell.exe is 23/2/99. Be very careful, I lost a good few day messing messing around with the wrong version.

eshell.exe this link will open a new browser window, download, close the windo and drop back here

Before I give you the command line I also recommend the other option and that is using Frank Bodmann's javac wrapper on his page. It will take out some of the typing and given that it comes with the source you can actually modify it on you Psion and adapt it to your needs. You will need to copy the zip file containing the classes to /system/java/ext, you will have to create the sub-directory ext, this is where the Psion looks for it's extension zips. Keep the zip file but also unzip a copy and put the Javac.class (plus two others) into the directory you are going to compile from. When you run Frank's shell (by clicking on the Javac.class) you will need to provide the local path of the source.

Finally, if you've loaded the shell, try to run it by clicking on it. You should have a familiar C:\>, change to your directory (email me if you're stuck here of by a book on DOS for dummies), I have put my source in D:\Java so I typed "D:" and "cd Java". To compile you should now type the following:-

"\system\programs\java   sun.tools.javac.Main   D:\Java\myprog.java"

You may also like to setup a java console by creating a file (of any type) called console in the directory \system\java. Away you go, ... Please let me know how you get on, and please let Frank and me know if you adapt his program or any others in the area. It would be nice to add a properties file to his program to read default directories. My other tips are to get Serge's PsiZip distributed by RMR, it's 100% compatible with Java jars and zips.

Please let me know how you get on and if you get the time please drop in a take a look the photos on my web site.

John Davies 9th July 1999