Java VM Compatibility
I attended a seminar today where the speaker (an Oracle consultant) was talking about Java portability and claimed that Java VMs from different vendors that support the same version of Java are always compatible. He said there would be no problems running code written for one platform on a same-version VM on another platform.
Incompatibility is especially apparant when you are going after backward compatibility. Old browsers of one brand or other all handle Java applets in slightly different ways. There are even one of two browser VMs that can't even multi-task using threads. But you can always use a safe subset of the full range of APIs, compatibility will get you very far on the server-side provided you note some of the big gotchas. The foundation libraries works pretty well, but you probably have to have a support line and test on all VMs your customers might use.
In my experience, there is no problem of JVM compatibilities for the same version if :
We are currently using J2SE and J2ME from Sun for our product. Both work as expected. We are also evaluating 2 VM's from 3rd parties because they offer increased performance over the Sun VM.
The only "incompatabilities" I've found with various JVMs are GUI inconsistancies. OSX's JVM wants to use native widgets, and they sometimes come out looking strange. The fonts don't always look the same either.
Recent (jdk 1.2 and above) compatibility tends to be really good. On the server side especially I have no expectation that, for example, code I write and test on Windows XP, will need to be debugged on Linux. There are some mistakes one can make in this regard (classic example, hard coding the file separator character in a string instead of using the java libraries to retrieve the appropriate one for the platform the code is running on).
I've developed some J2EE systems that were ported from one OS to another. In one project, it was Solaris -> HP-UX, in the other HP-UX -> AIX with Linux and Windows also being used in development environments.
Fog Creek Home