JVPC home GPL/LGPL Download/Install Java VMs JVPC/VPCheck People Kero's VGAP-page Project Page

Running JVPC on a Pocket PC PDA using J9 from IBM.

Michael Hodgins



Intro



This is a short tutorial to explain how to run JVPC on a Pocket PC PDA. The equipment I've used is simply the equipment I own, namely a Dell Axim that runs Pocket PC 2003. The J2ME™ virtual machine I've chosen is IBM's J9 product, which currently retails for $6 on the Handango Website[1]. As far as I'm aware, it is only available for the Arm processor but my Dell has an Intel Xscale, so it might be worth a try if you're not sure. The software is available as a free trial.

Installing this software is easy; simply run the executable, ensuring that your PDA is docked before starting. The sizeable download also contains a binary distribution for Linux based PDAs but as I haven't got one of those, I can't instruct how to go about running JVPC on that particular platform; I would hope that the two aren't too dissimilar.

As I say, the download is quite large at about 84 MB but the installed JVM only occupies around 8MB on your PDA. Installing J9 is the easy part; getting it to run JVPC is a little trickier.


Running J9



J9 is a command line program. Before going into the details of how to a run command line program from within Pocket PC, I'd like to take a diversion and look at the J9 installation.

J9 is installed by default in "\Program Files\J9"[2]. If you browse to the "\Program Files\J9\PPRO10\bin" folder, you'll see that there are actually two versions of J9 installed; one is called j9.exe and the other j9w.exe.[3]

The only real difference between the two is that j9.exe opens your application with a console interface behind it, whereas j9w.exe doesn't. The w is short for windowless and this is similar to the desktop version of Java™ where you have java.exe and javaw.exe. j9w.exe is the default version and the one you should normally consider using. j9.exe is meanly for developers because it allows the application to give extra textual feedback to the user, via the console. We'll be using j9.exe because it does give some useful information when trying to get J9 and JVPC to work.

Now, back to it. We actually have two ways to run JVPC through J9 but neither is particularly user friendly. The first way is to open Pocket PC's Run dialogue. This is best attempted with no programs open; they can be minimised but if they are active, the button press can get confused. To open the command line prompt, hold down the action button and then click and hold the clock. When the little circle thing has gone all the way around, release both. The action button is the main button, usually on the front on the PDA; my Axim actually has two action buttons; one on the front and one on the side but both do the same.

The action opens a menu, offering Run and Clock; we clearly want Run, which opens the Run dialogue. Users of Windows' Run dialogue and the command line prompt will be familiar with this beast and the way it interprets the space character. In order to get Windows to understand that \Program Files is a folder, not a command, it needs to be enclosed in double quotes. Therefore, to execute j9.exe, the following command must be entered:


"\Program Files\J9\PPRO10\bin\j9.exe"


If all is well, this should load the J9 console. Unfortunately, you may also receive an error message in the console that opens, that reads "Unable to load jclfoun10_22: The specified module could not be found". The reason for this error is that J9 is looking for the wrong module. The module that is installed is called jclppro10_22 and it is easy to change J9 to try to load this one in stead. We just need to add the argument -jcl:ppro10 to the end of the command we used earlier. It should now read:


"\Program Files\J9\PPRO10\bin\j9.exe" "-jcl:ppro10"


Notice the space between the second and third double quote characters.


Running JVPC



We're now getting to the fun part. Installing JVPC is easy, as you simply need to copy the file JVPC.jar file to your PDA; I placed it straight into "\My Documents". You also need to put your game data onto your PDA. I'll assume that you've placed it into a folder called "\My Documents\game". There are three pieces of information that we need to include in the command; two tell J9 what to do and the last tells JVPC where your game data is.

The argument -cp \My Documents\JVPC.jar tells J9 that the application we want to run is contained in the JVPC.jar. Then the argument jvpc.jvpc.JVPC tells J9 the name of the application itself.[4] Lastly, the location of the game data needed by JVPC is added at the end. The full command is


"\Program Files\J9\PPRO10\bin\j9.exe" "-jcl:ppro10" "-cp" "\My Documents\JVPC.jar" "jvpc.jvpc.JVPC" "\My Documents\game"


If all is well, this should open the game in JVPC. If JVPC appears for a moment but then disappears and the console shows a fatal error 11, this is usually because the game data hasn't been found. You should check that the last argument in the command above is correct.


The easier way


Typing these commands into the Run dialogue isn't terribly user-friendly, especially as the Run dialogue doesn't remember your last entry correctly, so it is a good idea to create a shortcut. This is easiest to do from your desktop PC. Simply create a shortcut in the normal manner, by right clicking and selecting New>>Shortcut in Windows Explorer. It doesn't matter what the shortcut points to. Rename the shortcut to something convenient - like jvpcGame - remembering to delete the extension if there is one. Then open the shortcut file[5] in notepad and delete all the contents and replace it with 255# plus the command we put together earlier. So it should how read, all on one line:


255#"\Program Files\J9\PPRO10\bin\j9.exe" "-jcl:ppro10" "-cp" "\My Documents\JVPC.jar" "jvpc.jvpc.JVPC" "\My Documents\game"


Put this file on your PDA. You should see that the shortcut file on your PDA has the same icon as the j9.exe and j9w.exe files. Magic. Clicking the shortcut will run JVPC.

When you're happy that JVPC is running correctly, you can change the shortcut to use the windowless version of J9:


255#"\Program Files\J9\PPRO10\bin\j9w.exe" "-jcl:ppro10" "-cp" "\My Documents\JVPC.jar" "jvpc.jvpc.JVPC" "\My Documents\game"


Well, that's all there is to it. Any feedback is gratefully accepted and should be directed to the usual place.



[1]The retail name is "WebSphere Everyplace Micro Environment Personal Profile 1.0 for Windows Mobile 2003 - 1 Pack by IBM" and the address for this is http://www.handango.com/PlatformProductDetail.jsp?productType=2&optionId=1_2_2&platformId=2&siteId=1&productId=140997&programId=458&affiliateId=1218

[2]That's not "\My Device\Program Files\J9" by the way. "\My Device" seems to be the Pocket PC equivalent to C:\ on Windows.

[3]This folder also contains a number of other files that are hidden by default. Amongst these files is one called jclppro10_22.

[4]There are three programs in the JVPC.jar, the others are jvpc.blitz.Blitz and jvpc.vpcheck.VPCheck.

[5]The actual shortcut file, not the destination file, but you knew that already.


Kero
JVPC home GPL/LGPL Download/Install Java VMs JVPC/VPCheck People Kero's VGAP-page Project Page