« What makes a Team Leader? | Main | Bill Gates is "not some media expert" »

Java on PocketPC (Unofficial FAQ)

December 06, 2004

Comments & Questions

Shameless plug: This FAQ has been the #1 hit on Google for Java PocketPC for about a year.  That's why it's important that you please post comments publicly so other people can have a chance to answer (anonymous is allowed !!).  But if you're too shy for anonymous comments ;-), you can still email me.  Corrections and additions (related info) are also welcome.

About this FAQ

There is a lack of practical publicly available info for Java developers interested in PocketPC software development.  This page is my attempt to collect information in one place to help people get started with J2ME/CDC development, otherwise known as Java on PocketPC.  This FAQ is not affiliated with Sun in any way, which means I can offer practical information about competing JVMs and APIs. If you're reading this as a printout, the latest copy of this FAQ is available from: http://blog.vikdavid.com/2004/12/java_on_pocketp.html

What is J2ME/CDC?

Sun has categorized the Java platform into three camps:

  • Java on servers, or J2EE
  • Java on desktops, or J2SE (also known as "core" Java)
  • Java on mobile devices, or J2ME

The J2ME camp is made up of a lot of APIs further categorized into "Configurations" and "Profiles".  CDC is one of the Configurations, which stands for "Connected Device Configuration".  Sun targets CDC at a broad range of devices. In reality, the CDC is available for real world-use by any developer (not just OEMs) on the PocketPC device, Nokia Series 80 phones, and recently announced Nokia Series 60 phones. 

I haven't gotten my hands on a Series 80 phone yet, but I'm hoping a lot of the info in this FAQ will apply to Series 80 devices, in addition to PocketPC's.  Except, the fact that Series 80 devices come with IBM's J9 JVM pre-installed for free - nice!!.  Oh, and CDC apps will also run on any Java desktop PC or laptop!  I guess that makes J2ME/CDC, "the other Desktop Java".

Read Sun's official CDC faq for more details.

What PocketPC devices are available?

Each issue of Pocket PC Magazine([online]) has a center page with a tabular listing of all available PocketPC devices from HP, Dell, Toshiba, etc with specs on CPU, Storage, Peripherals, etc.  I think its the best "one stop" comparison of PocketPC devices. Alternatively, Microsoft has a listing of devices on the Microsoft PocketPC official site divided by regional availability for Americas, EMEA, and Asia/Pacific. I myself use an HP iPAQ RX3115.

What JVMs are available for PocketPC devices?

This is probably the most popular question and biggest barrier for Java on PocketPC.  The answer is simple: use IBM's J9 JVM or NSICOM's CrEme JVM.  There are several other JVMs on the market, but they all suffer from these problems: not supported anymore (Sun's PersonalJava), not fully Java compatible (SuperWaba), not fully Java compatible (EWE), on sale to OEMs only (Esmertec JBed, formerly Insignia Jeode), or out of date (Insignia Jeode).

The pricing options for IBM's J9 JVM are very good at $5.99/each and discounts for bulk.  If you are an individual developer, this is for you.  NSICOM's Creme JVM has a free trial download, plus they sell a developer license of 40 units for $1000, and also offer discounts for bulk.

IBM J9 can be purchased from Handango for $5.99, and NSICOM Creme can be purchased directly from NSICOM.

Is there a free PocketPC JVM?

A reader of this FAQ alerted me to the Mysaifu JVM which seems to be free.  This was first released on April 16, 2005 so it's very new, and I haven't tried it out yet. Benjamin Brown made an effort to ask Sun about a free PocketPC JVM [Read Java Forum thread here, and related Slashdot article here].  There is a rumor that Sun has a project code named "Captain America" which is a free PocketPC JVM, but cannot release it because the market-demand to support such a product is not there.  With all that said, the IBM J9 JVM is only $6/unit, which is not a bad price. :-)
More information on PocketPC JVM's:

  • Mikko Kontio's Java on PocketPC devices for InformIT Magazine (Oct 22, 2004) [link]
  • Stan Berka's JAVA for PocketPC PDA's (Oct 2004) [link]
  • Dan Fitton, Rod Montrose's summary of Java Support on Pocket PC's [link]
  • Rick Grehan's Deliver Big Functionality on Small Devices (summer 2002) [link]

Where can I get more information on the IBM J9 JVM?

IBM uses a couple of different marketing names for this product.  "J9" is the name of the actual JVM, although I've seen it referred to as "IBM WebSphere Everyplace Micro Environment".  IBM also sells an Eclipse-based IDE called "WebSphere Studio Device Developer" (WSDD) for around $600 that includes IBM J9. 

IBM's Ottawa Software Lab makes IBM WebSphere Everyplace Micro Environment (aka J9 JVM).  You can purchase it directly from Handango for $5.99 per unit.

Update on April 19, 2006: A reader of this FAQ writes, IBM has updates the J9 runtimes for WindowsMobile 2005 with CDC/Foundation/Personal Profile 1.1 . See http://www-128.ibm.com/developerworks/websphere/zones/wireless/weme_eval_runtimes.html

Where can I get more information on the NSICOM Creme JVM?    

NSIcom makes the CrEme JVM for PocketPC devices.  There is a trial download available on the NSICOM website.

Related article: Dec 2001 — Rick Grehan's Get CrEmed for JavaPro Magazine, published Dec 2001; Summary: "CrEme, a descendant of the Java Software Coprocessor from NSIcom, is a Java virtual machine for Windows CE devices that has some clever plumbing".

What happened to the "free" Jeode JVM that came with iPAQs?

Insignia ran into financial trouble and sold Jeode to a Swiss company called Esmertec.  Esmertec already had an OEM-only JVM product called JBed.  You can buy Esmertec Jeode for $49.99 for Dell AXIM or PocketPC 2002 devices.  I have not used this product after Esmertec bought it, but be careful, the sale page seems to mention "PersonalJava" compatibility, which is the older pre-J2ME/CDC spec.  It's also much more expensive than either J9 or Creme.

What books are available for Java on PocketPC?

There are a LOT of books that claim to cover J2ME.  However, they usually cover only cLdc/Midlets and not CDC/PocketPC.  Here are a couple that I found useful:

 

What blogs/forums are relevant for Java on PocketPC?

There are no specific blogs dedicated to this topic, but there are some general J2ME related blogs:

Is there an IDE for Java on PocketPC development?

There are several IDEs that claim to be J2ME-aware.  But my experience is that they only include functionality for Midlets, or J2ME/cLdc.  Not for J2ME/CDC.  However, the good news is that since J2ME/CDC APIs are so close to regular desktop Java (J2SE) APIs, you can get away with using your regular Java IDE!

Update on May 5, 2006: A reader sent in this link on Netbeans new CDC/PocketPC support.

What User Interface API should I use?

If you were writing a regular desktop Java application, your options would be AWT, Swing or SWT.  Theoretically, you have the same options available for Java on PocketPC.  I've personally used AWT and know that it works well. If you're thinking about Swing, I'm not sure it's available by default on IBM J9 and NSICOM Creme.  Even if it is, keep in mind that Swing may be less performant than AWT or SWT since it does not use native widgets.  On PC's, this may not be an issue anymore, but since PocketPC's are less powerful devices it's worth taking into consideration.  Read Stan Berka's note [link] and Pat O'Neil's note [link].
The newer SWT API sounds promising.  Check out Christophe Cornu's A Small Cup of SWT (Sep 19, 2003) and Glen Smith's First PocketPC SWT App (Nov 2004).  Also the official SWT site is here [link].  And yet another link: HOWTO run SWT app on PocketPC Emulator

What SQL databases are available?

This is one of CDC's strength's over cLdc/Midlets.  You can use a regular SQL database and program to the JDBC API you're already familiar with.Here is a list of options:

  • PointBase - $$ commercial, pure Java, designed from the ground up for high-performance, small footprint, mobile devices. 
  • Oracle Lite - $$ commercial, native binary for PocketPC.
  • Sybase SQL Anywhere (ASA) and Native Ultralite for Java - $$ commercial, native binary for PocketPC and ative Ultralite for Java.
  • IBM Cloudscape aka Apache Derby - free/open-source, pure Java.  I haven't used this on PocketPC, but it is pure Java with a small footprint, so it should work with J9 or Creme on PocketPC.
  • Microsoft SQL Server CE - I believe this is free if you own a SQL Server license, and I'm not sure if there is a good JDBC driver (not the JDBC-ODBC bridge) for the SQL CE edition.

In addition, there are a lot of embeddable Java databases out there.  Though they don't specifically say they're meant to run on PocketPC-type devices, any database written in Java could theoretically run on your PocketPC JVM.  There is a list of open source Java databases on java-source.net. And a new edition: Daffodil DB.

How should I go about writing and deploying a HelloWorld app?

You can write and compile your app on a desktop like you normally do.  Deploying is "the hard part". Read this message thread as it talks about downloading the right version of J9, compiling/deploying your app, and creating the PocketPC shortcut file to launch it.

Can I run Java Applets on PocketPC?

Yes, I know Esmertec Jeoede JVM comes with a plug-in for Pocket Internet Explorer to view Java Applets on PocketPC.  It's stored in \Windows\iepluginvm.exe.  There is a sample HTML with an applet under: Windows\iexplore.exe \windows\lib\Quasar.html

What is the difference between cLdc/Midlets and CDC/PP?

CDC/PP stands for Connected Device Configuration with Personal Profile.  cLdc/Midlets stand for Connected LIMITED Device Configuration with Midlets.  In a nutshell CDC/PP has a lot more APIs and is geared toward more powerful mobile devices.  Russell Beattie explains the difference in his blog here and here.

Are there any RAD tools for developing business apps?

Yes, a company called mobiforms makes an IDE to create apps which run on IBM J9.  As with all RAD (rapid application development) tools, you have to weigh the pros/cons of using something like this: you gain time-to-market and development ease, but loose the customization of writing your own custom software.

Links to external articles

December 6, 2004 at 11:56 AM in Java | Permalink

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d834205eab53ef00d8342c60cc53ef

Listed below are links to weblogs that reference Java on PocketPC (Unofficial FAQ):

» Windows Mobile development information from Confluence: KClient
#bottom Introduction This page gathers links to pages I find to be interesting in the context of rewriting our PalmOS client in Native WM. Microsoft .Net Glossary [Read More]

Tracked on Mar 12, 2007 8:10:38 AM

Comments

I keep reviewing the latest developments in the Pocket PC Java world in my Pocket PC Mag Expert blog at http://www.pocketpcmag.com/blogs/index.php?blog=3 and in major Pocket PC forums. For example, today, I've posted a lengthy review & tip & bug collection of the new IBM J9. Definitely worth a read IMHO, as with all my other Java-related articles.

Posted by: Werner Ruotsalainen | May 9, 2006 4:25:18 PM

Sorry for the newbie question, but how does JNI fit into all this? If I have a J2SE-plus-C application that uses JNI to connect Java code with C code, is it possible to port the combo to a mobile device? My C code connects to UDP stack and drives network connection. I would like to avoid having to convert the C portion to Java. Thanks.

Posted by: anonymous | May 17, 2006 7:05:02 PM

> how does JNI fit into all this?

Anonymous, read this post on the Sun CDC mailing list. Seems to me you would also have to port your C application to PocketPC.

Posted by: Vik | May 18, 2006 8:48:05 AM

Question, and it may be on teh newbie side. I consider myself a solid java programmer (J2SE), but need to check something before starting a new project that would go on the Dell Axim handheld(s).

I am assuming that regardless of Windows CE or Mobile 5, the IBM J9 will run fine?

Posted by: Specialist | May 22, 2006 2:28:05 PM

Can anyone advise me on how to disable the midlet manager (intent Java midlet manager version 1.5.7 Tao Group Ltd) on the xda2 as it seems to want to take control of my java programs, rather than let the jvm handle them!

Posted by: Edward King | Jun 30, 2006 6:57:58 PM

I don't understand why you say Creme is inexpensive. Only the Creme evaluation is "free", and it only works for 30 days. NSICom does not sell creme to individual users, whereas anybody can download J9 for personal use. NSICom sells creme in a minimum of 40-user license kits for $1,000.00! Or have you heard otherwise from them, because they quoted me this price via email this past weekend.

Posted by: Gary Childers | Jul 18, 2006 5:51:54 PM

Please help.

I have installed NSICOM and it now associates JAR files with this program. When I tap the jar files I want to run, a screen says "Loading Creme".. and then nothing.

Nothing opens. No erros.. nothing.

What's gone wrong?

Why is it so difficult to get a simple jar file to run on a hand held device!!

Frustrted. - i've been hussling with this for 2 days. Please help - by email.

Posted by: pocketrocket | Jul 19, 2006 4:26:22 PM

i'm trying to run a MIDP 2.0 app on an HP IPAQ 4150 and i can't find a Java VM that will run it. anybody know of one? i tried J9 but it crashes every time i start the MIDlet.

Posted by: Alexander Boyd | Jul 20, 2006 2:38:28 PM

> I don't understand why you say Creme is inexpensive.

Actually, I'd say J9 is inexpensive. By the way, it's been 2+ years since I emailed Creme about pricing, and they quoted me the same price as you said: 40 licenses for $1000. They're clearly not targeting individual developers. --Vik

Posted by: Vik | Jul 21, 2006 7:14:01 PM

> When I tap the jar files I want to run, a screen says
> "Loading Creme".. and then nothing.

Pocketrocket, I always launched creme and my Jar using a PocketPC shortcut. Not by just clicking on the JAR. A PocketPC shortcut to start your JAR using creme could look like (modify path to jar and startup class):

18#"\Windows\CrEme\bin\CrEme.exe" -sp:1 -tiny -noverify -aa 0 -vkb -ntb -Of -classpath .;\installdir\myjar.jar com.foo.StartMyProgram

Posted by: Vik | Jul 21, 2006 7:30:12 PM

Vik,

Why cant there be a simple click and run option, such as running files and games on a desktop pc?

It's so awkward.

Posted by: PocketRocket | Jul 22, 2006 11:05:31 AM

Vik,

Could you please post full instructions.

How do I create a shortcut?

If my jar files are stored in:
\My Documents\JAVA Games

How would I then launch a file called:
Midnight Pool V100.jar

Please help.

Posted by: pocketrocket | Jul 23, 2006 2:27:20 PM

Can you actually develop programs on a handheld? Develop, edit, compile, and run completely on a handheld? I think most developers would develop on a laptop or desktop then download the app to the handheld. I want to do programming on the go.

Any advice on the tools I need for my handheld to do this?

Posted by: David | Sep 29, 2006 8:16:04 PM

All I want to do is purchase a single license for CrEme to use to view Java web pages on my Dell Axim X30. I can't find anywhere that will sell me a single license. Does anyone know where I can buy this product?

Posted by: Chris Davis | Oct 16, 2006 6:24:11 PM

David, you can edit / compile Java sources on your Pocket PC. I've explained this over at Pocket PC Thoughts - please read http://www.pocketpcthoughts.com/index.php?action=expand,40880

Posted by: Menneisyys | Oct 20, 2006 2:44:18 AM

I just tried to install the Mysaifu JVM on my Sprint PPC 6700 (WM5), but it would not install. Props to the developers working on it though. It looks like a lot of work and the community would much appreciate the results. Guess I'll have to find $6 somewhere. ;)

Posted by: Andrew Cain | Nov 2, 2006 9:51:53 AM

To David Kenyon
Re "Develop, edit, compile, and run completely on a handheld?"

Yep, I do it on the plane all the time. Cheesy, but who cares. Here is what I do.

Prerequisites:
*JEODE installed on the Pocket PC, including the compile libraries (rt.jar & tools.jar
which must be placed in \Windows\lib\)
*JDK 1.4.2 or similar installed on the Linux box
*Eclipse 3.1 or similar installed on the Linux box
*Flash memory adaptor on Linux box or another way of transferring files (e.g. Bluetooth)
between the two platforms
*An MS-DOS shell for the Pocket PC. I use the one that comes with the free C# IDE

Solution:

(1) On the Pocket PC, create the folder \Java and add these three scripts to the folder
java.bat which contains:
\Windows\evm.exe -Djeode.evm.console.local.keep=true -cp \Java %1a
javac.bat which contains
Cd \Java
rename %1.txt %1.java
\Windows\evm.exe -Djeode.evm.console.local.keep=true -cp \Windows\lib\tools.jar;\Windows\lib\rt.jar sun.tools.javac.Main \Java\%1.java
rename %1.java %1.txt
ls.bat which contains
dir /b %1
(2) On the Linux box, develop the Java project (e.g. TestAppProject) in a workspace folder
(e.g. Workspace) in the user's home directory. I set the Eclipse project attribute to
keep source and class files in the same directory structure, so that my compile script
on the Pocket PC will work OK when I need to tweak the Java. I also leave the scripts
from step 1 (above) in the project, so I can skip most of that step.
(3) Basically, to transfer the project to the Pocket PC, just drag the contents of the Java
project folder (e.g. contents of TestAppProject) to a Flash card then plug it into the
PDA and copy it to \Java. Alternatively, jar or tar it and use Bluetooth ftp or similar
process to do the move.
(4) On the Pocket PC, now you can execute it:
cd \Java
java TestApp
You can edit it
rename whatever.java whatever.txt
Then use Pocket PC GUI editor, script will automatically rename it.
You can compile it
javac TestApp
or one of the packaged classes
javac Invokers\ExecShellCmd

This is a little cheesy but it works fine! Amazing how much functionality you can get on the PocketPC and still debug or tweak it in flight while not connected.

Jim

Posted by: Jim | Nov 13, 2006 8:56:35 PM

just wanted to Say thanks this is a great Site thanks to every one!

Posted by: Zac Brown | Nov 20, 2006 5:08:46 PM

All I want to do is purchase a single license for 'J9' to use to view Java web pages on my Qtek 9000.

And it seems Handango still sells only the Pocket PC 2003 release; the Windows Mobile 5 version is missing on their catalog....

- Any idea about how to purchase a 'J9' for WM5, please?

- Also a clarification: at the Ibm web site, is the 'WebSphere Everyplace Micro Environment 6.1.1 - CDC 1.1/Foundation 1.1/Personal Profile 1.1 for Windows Mobile 5.0/ARM' to be downloaded as a simple JVM runtime to surf the java applet on the web on a HTC / Qtek 9000 pda?

I'm an end-user, not a developer.

Any help,please? Thank you! :-)
Giovanni

Posted by: giovanni | Dec 21, 2006 1:56:10 PM

Thanks for the great page!

After reading this and other pages I am still confused about the relationship between J2ME/CDC and JVMs such as J9 and CrEme.

Isn't J2ME/CDC just another "free JVM for Pocket PC"? If so, why don't you include it in the answer to "What JVMs are available for PocketPC devices?"? And if it is not, why not? Is it because it is a limited subset of the language? Does that mean the J9 is *not* a limited subset and runs actual J2SE?

Thanks,

Rodrigo

Posted by: Rodrigo | Dec 31, 2006 1:31:27 AM

J2ME/CDC is standard based on J2ME -- i.e. it's not J2ME. J2ME is not the language, but is equivelant to (but much richer than) the standard C library or C++ Standard Template Library.

J2ME/CDC is NOT a compiler or a virtual machine. It's a standard and if you have an app that claims to run on a J2ME/CDC environment it should run on all and any J2ME/CDC compliant virtual machine (with the right classes avaiable).

The language (Java) defines how you are allowed to write classes, not the classes themselves.

Read Q1 for most of this.

Posted by: Clearer | Jan 2, 2007 5:54:23 AM

I have a program I've written with versions in both J2SE for desktops and J2ME/CLDC for cell phones (http://crosswire.org/flashcards, http://crosswire.org/fc). Which of this should I recommend to users with PocketPC devices? Do I need to write a 3rd version or will CLDC applications run on CDC devices? I THINK what I should say is:
Purchase J9 from IBM for 6 bucks, then download the cell phone (CLDC) version. But I'm not sure. Thanks for your page and help.

Posted by: scribe | Jan 17, 2007 10:42:19 AM

Hi everybody,
sorry if my english is very bad ... :)
I tried to launch an open source project called "Open jump" (http://openjump.org/wiki/show/HomePage) written in JAVA and i tried to execute it on a PDA (DELL Axim x50) with CrEme but i have several errors. I'd like to know if it's possible to launch that kind of JAVA application on a PDA and if somebody tried to launch a JAVA application compiled for windows.
Thanks for your answers.

Posted by: Nico | Mar 6, 2007 11:18:27 AM

Looks like "Captain America" is slowly getting off the ground under the name of "PhoneME":

https://phoneme.dev.java.net/

Still in development but it looks like it will be the free PocketPC JVM everyone has been looking for.

Posted by: Stephanie | Apr 3, 2007 3:37:57 PM

Nice blog!

I'm trying to find out if any of the different available JVMs for the PocketPC does support the JVM Tool Interface (JVMTI). Does anybody know? Thanks!

Posted by: Wildjack | Apr 5, 2007 11:56:20 AM

Post a comment