tags:

views:

309

answers:

5

If I'd switch from Sun JDK to OpenJDK which surprises do I have to prepare myself for?

What does frequently go wrong and how difficult can this be?

Of course, each and every application can have its individual problems, but I'm looking for classes of problems, something many people already have struggled with when switching JDKs.

+1  A: 

Since OpenJDK is a Sun project, based on the original Java source, I wouldn't expect many problems. The only area where things can break is the code which had to be replaced (because it couldn't be released under the GPL) or changes because of new features (but those should be pretty much the same as in the official JDK).

Aaron Digulla
"The only area where things can break is the code which had to be replaced" - do you happen to know what those areas were?
Paolo
+1  A: 

As I know fonts will look garbled, Sun had to remove original ones from OpenJDK since they are not 'open source' and JVM will use some default which are not so nice...

ante.sabo
Yes, this was our biggest issue when we migrated.
Kevin Bourrillion
+1  A: 

Use an OpenJDK build known to pass the TCK to minimize the surprises.

Thorbjørn Ravn Andersen
+3  A: 

It is unlikely that anything will go wrong with OpenJDK. It is considered 100% compatible by now. But I think it is good to know what parts had to be rewritten and therefore are not using the same code as the SunJDK.

The Wikipedia entry has a good overview of this:

As of May 2008, the only part of the Class library that remains proprietary and closed-source (4% as of May 2007 for OpenJDK 7, and less than 1% as of May 2008 and OpenJDK 6) is the SNMP implementation.

Since the first May 2007 release, Sun Microsystems, with the help of the community, has released as free and open-source software or replaced with free and open-source alternatives almost all the encumbered code:

  • All the audio engine code, including the software synthesizer, has been released as Open-source. The closed-source software synthesizer has been replaced by a new synthesizer developed specifically for OpenJDK called Gervill,

  • All cryptography classes used in the Class library have been released as Open-source,

  • The code that scales and rasterizes fonts has been replaced by FreeType

  • The native color management system has been replaced by LittleCMS. There is a pluggable layer in the JDK, so that the commercial version can use the old color management system and OpenJDK can use LittleCMS.

  • The anti-aliasing graphics rasterizer code has been replaced by the Open-sourced Pisces renderer used in the phoneME project. This code is fully functional, but still needs some performance enhancements,

  • The JavaScript plugin has been open-sourced (the Rhino JavaScript engine itself was open-sourced from the beginning).

Bani
OpenJDK as included in most Linux distros is not 100% compatible. The implementation of Java Sound comes from IcedTea and it behaves differently than the Sun one. For example, it throws an exception if you try to write to a closed line, which is how nearly all existing Java Sound code works (e.g., JavaZOOM, jsresources.org). With the font rendering difficulties too I'd call it "only" 98% compatible.
Yuvi Masory
A: 

Some of the swing UI's did not match up entirely (metal had paddings that were off just aenough to notice). Note that this was 8 months ago.

KitsuneYMG