Alfresco And OpenJDK

From alfrescowiki

Jump to: navigation, search

It is possible to use the Alfresco Community Edition with OpenJDK, but not always without some changes.

What version do I have?

Run java -version to check.

  • IcedTea6 is the Java 6 version
  • IcedTea7 is the Java 7 version
  • IcedTea6 1.6.1 is the Java 6 version, release 1.6.1
  • IcedTea6 1.7.1 is the Java 6 version, release 1.7.1
  • IcedTea6 1.8 is the Java 6 version, release 1.8
  • IcedTea7 1.1.2 is the Java 7 version, release 1.1.2

The number after IcedTea tells you the java version it provides, the numbers after that are the version of that Java interpreter.

As an example:

$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK Server VM (build 14.0-b16, mixed mode)

This is the Java 6 version of OpenJDK, and is the 1.6 series of IcedTea6, built for Ubuntu (in this case Ubuntu 9.10).

As another example:

$ java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK Server VM (build 14.0-b16, mixed mode)

This is the Java 6 version of OpenJDK, and is the 1.8 series of IcedTea6, built for Ubuntu (in this case Ubuntu 10.04)

OpenJDK IcedTea6 1.5 and earlier

We do not recommend that you try to use Alfresco on OpenJDK versions before 1.6. This includes the version with Ubuntu Jaunty (9.04) or Fedora Core 9.

OpenJDK IcedTea6 1.6

The 1.6 series of OpenJDK/IcedTea6 is available in a number of recent Linux distributions, for example Ubuntu Karmic (9.10) and Fedora Core 10 and Fedora Core 11.

There is one large bug which affects the use of the Alfresco Community Edition on this platform, which relates to the Rhino JavaScript interpreter.

When the Rhino library has been upgraded, then the Alfresco Community Edition (3.3 or later) should work fine. This platform receives a small amount of testing at this time.

Upgrading the Rhino JavaScript Engine

The IcedTea6 1.6 version of OpenJDK ships with an older version of the Rhino JavaScript interpreter. This version lacks the E4X XML library. If you try to run webscripts for example, they will fail with an error along the lines of:

org.mozilla.javascript.EcmaError - ReferenceError: "XML" is not defined. (AlfrescoScript#1)

The older Rhino library shouldn't normally be an issue, as the Alfresco Community Edition ships with a newer Rhino version. However, because Rhino jar is placed in the OpenJDK bootstrap directory, and no package renaming is done (as happens with the Sun JDK), the newer Rhino jar from Alfresco is ignored. More details are available from:

There are two main workarounds - manually upgrade the Rhino jar in the JDK, or remove the Rhino jar from the JDK. The former is more advised, as the latter will break other things that don't ship their own Rhino Jar, and rely on the system one.

You will find rhino.jar within $JAVA_HOME/jre/lib/ (it may well be a symlink). This version should be removed, and a newer one put in its place with the same name. It is very important that the new jar is also called rhino.jar as OpenJDK appears to have the jar name hard coded into it!

If you wish, you can use the Rhino 1.6R7 version that ships with the Alfresco Community Edition 3.3. Alternately, you can also download the 1.7R2 version from http://www.mozilla.org/rhino/ and use this instead.

To test if you have correctly installed the new Rhino Jar, try running

java org.mozilla.javascript.tools.shell.JSConsole

If the console window loads, it is installed fine. If you get a java.lang.ClassNotFoundException, then the chances are that jar isn't in the right place, or doesn't have the correct name.

OpenJDK IcedTea6 1.7

The 1.7 series of OpenJDK/IcedTea6 is, despite the slightly confusing name, a Java 6 edition. It is included with some recent Linux distributions, for example Fedora Core 12.

This platform is also affected with the same Rhino JavaScript interpreter bug as OpenJDK IcedTea6 1.6. See the section above for a workaround.

OpenJDK IcedTea6 1.8

The 1.8 series of OpenJDK/IcedTea6 is, despite the slightly confusing name, a Java 6 edition. It is shipped with Ubuntu Lucid (10.04), and probably Fedora Core 13.

There are no known issues with using the Alfresco Community Edition (3.3 or newer) with the 1.8 version of OpenJDK/IcedTea6 (the Rhino bug is fixed in 1.8 for example). However, this is not a platform that currently receives much testing.

Alfresco Enterprise Edition v3.3 is fully certified on Ubuntu 10.04 (Lucid, LTS), using OpenJDK IcedTea6 1.8. [1]

OpenJDK IcedTea7

This is the Java 7 version of OpenJDK. At this time, no testing is being performed on running the Alfresco Community Edition on this platform.

Personal tools
© 2014 Alfresco Software, Inc. All Rights Reserved. Legal | Privacy | Accessibility