Apache Harmony

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
Apache Harmony
Developer(s) Apache Software Foundation</td></tr>
Stable release 5.0 M12 / December 5, 2009; 132437965 ago</td></tr>
Written in C++ and Java</td></tr>
Operating system Windows and Linux</td></tr>
Development status Active</td></tr>
Type Java Virtual Machine and Java Library</td></tr>
License Apache License 2.0</td></tr>
Website http://harmony.apache.org</td></tr>

</table> Apache Harmony is an open source / free Java implementation, starting with Java SE 5.0. It will be licensed under the Apache License, Version 2. It was announced in early May 2005 and on October 25, 2006, the Board of Directors voted to make Apache Harmony a top-level project.




The Harmony project was initially conceived as an effort to unite all developers of the Free Java implementations. Many developers expected that it would be the project above the GNU, Apache and other communities. GNU developers were invited into and participated during the initial, preparatory planning. Later it was decided not to use the code from GNU Classpath, and that Harmony would use an incompatible license; therefore blocking the sharing of code between Harmony and existing free Java projects. Apache developers would then write the needed classes from scratch and expect necessary large code donations from software companies.

Reasons for rewriting from scratch

The main reason for disagreements between the GNU Classpath and Apache projects is due to differences between the GNU General Public License (GNU Classpath's license also contains the linking exception) and Apache License. These disagreements are inspired by various organizations and individuals[1] that prefer the Apache License, which allows for closed source derived works. GNU Classpath can also be linked[2] with proprietary code, but it is legally difficult to make a closed source derivative of GNU Classpath itself. However, many free software developers think that the licenses and philosophy of these communities are not different enough to split the efforts, and the inability to find compromises is frequently estimated negatively. The occasionally appearing suggestion to view these projects as opposing forces does not find wide support. Enthusiasts of the free software tend to break the discussion with the simple words that "more free software is not a problem".[3]

Difficulties to obtain a TCK license from Sun


The Apache Software Foundation sent a letter to Sun Microsystems CEO, Jonathan Schwartz, on April 10, 2007, regarding their inability to acquire an acceptable license for the Java SE 5 Technology Compatibility Kit (TCK), a test kit needed by the project to demonstrate compatibility with the Java SE 5 specification, as required by the Sun specification license for Java SE 5.[4] What makes the license unacceptable for ASF is the fact that it imposes rights restrictions through limits on the "field of use" available to users of Harmony, not compliant with the Java Community Process rules.[5]

Sun answered on a company blog [1][2] that it intended to create an open source implementation of the Java platform under GPL, including the TCK, but that their current priority was to make the Java Platform accessible to the GNU/Linux community under GPL as quickly as possible.

This answer triggered some reactions, either criticizing Sun for not responding "in a sufficiently open manner" to an open letter [3], or rather Apache Software Foundation; some think that ASF acted unwisely to aggressively demand something they could have obtained with more diplomacy from Sun, especially considering the timescale of the opening class library [4] [6].

Since Sun's release of OpenJDK, Sun has released a specific license to allow to run the TCK in the OpenJDK context for any GPL implementation deriving substantially from OpenJDK[7].

Use in Android SDK

Dalvik, the Java Virtual Machine used in Google's Android platform, use a subset of Harmony for the core of its Class Library[8]. However, Dalvik does not align to Java SE nor Java ME Class Library profiles (for example J2ME classes, AWT or Swing are not supported). Instead it uses its own library[9], built on top of a subset of Harmony.

Development team

Apache Harmony started from being mostly developed by several companies, receiving large code contributions at once. However, the general discussions on the mailing lists were always opened for everyone, and later the Apache Software foundation mentors put a lot of effort[10] to bring the development process more in line with the Apache way,[11] and it seems that their efforts were highly successful. In November 1, 2006, the current team of committers consisted of 16 developers, 12 of them from IBM and Intel.[12]

Recent development status

Apache Harmony was accepted among the official Apache projects on 29 October 2006.


The Dynamic Runtime Layer virtual machine consists of the following components:

  1. The VM core: with its subcomponents concentrates most of the JVM control functions.
  2. The porting layer: hides platform-specific details from other VM components behind a single interface and is based on the Apache Portable Runtime layer.
  3. The Garbage Collector: allocates Java objects in the heap memory and reclaims unreachable objects using various algorithms
  4. Execution Manager: selects the execution engine for compiling a method, handles profiles and the dynamic recompilation logic.
  5. Class Library: is a Java standard library.
  6. The thread manager that handle Operating system threading
  7. The execution engine: contains of the following:
    1. The just-in-time compiler for compilation and execution of method code.
    2. The interpreter for easier debugging.

Support Platform and Operating System

The project provide a portable implementation that ease development on many platforms and operating systems. The main focus is on Windows and Linux operating systems on x86 and x86-64 architectures.[13]

Windows 2000 Windows XP, Server 2003, Vista Linux RHEL, SLES, Debian, Gentoo, Ubuntu, Fedora FreeBSD AIX Mac OS X
IA32 (Pentium III or better) In progress Yes Yes In progress Template:N/a Template:N/a
x86-64 (Intel 64, AMD64) Template:N/a Yes Yes Template:N/a Template:N/a Template:N/a
Itanium (IA64, IPF) Template:N/a In progress Yes Template:N/a Template:N/a Template:N/a
PPC32 Template:N/a Template:N/a In progress Template:N/a Template:N/a Template:N/a
PPC64 Template:N/a Template:N/a In progress Template:N/a In progress Template:N/a
zSeries (31 bit) Template:N/a Template:N/a In progress Template:N/a Template:N/a Template:N/a

Class Library Coverage

File:Java platform.svg
Java Platform diagram showing Class Library

The expected donations from software companies were actually received. The Apache Harmony now contains the working code, including the Swing, AWT and Java 2D code which were contributed by Intel.

The part of the implemented classes is still smaller than in GNU Classpath (97.7% in the trunk versus almost 100% as of July 2007[14]), despite some non-trivial applications were shown being running in 2006 JavaOne international conference.

Also Harmony's test suite is less extensive than GNU Classpath's for now (20000 tests [5] versus 50000 [6] as of October 2006).

The progress of the Apache Harmony project can be tracked against J2SE 1.4 and Java SE 5.0.[15] Also, there is a branch for Harmony v6.0 in development for Java SE 6.0.

Apache Harmony developers integrate several existing, field-tested open-source projects to meet their goal (not reinventing the wheel). Many of these projects are mature and well known and other part of the library need be writing from scratch.

This is a list of existing open source components that are used in the Apache Harmony project; some of them were in use before the project started.

Component Description
ICU Mature C/C++ and Java libraries for Unicode support, software internationalization and software globalization.
Apache Xalan An XSLT stylesheet processor for Java and C++ which implements the XPath language.
Apache Xerces An XML parser library for Java, C++ and Perl
Apache Portable Runtime Cross-platform abstraction library provides platform independence.
Apache CXF Robust and high performance Web Services framework work over protocols such as SOAP, XML/HTTP, RESTful HTTP, and CORBA.
BCEL Libraries for decomposing, modifying, and recomposing binary Java classes (i.e., bytecode)
MX4J Java Management Extensions (JMX) tools for managing and monitoring applications, system objects, devices and service oriented networks.
vmmagic Set of extensions to the Java language to facilitate systems programming in Java by adding direct memory operations etc.
Bouncy Castle Libraries collection of lightweight cryptography for Java and C#.
ANTLR language tool that provides a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages.


Harmony is currently less documented than the alternative free Java implementations. For instance, in GNU Classpath every method of the central CORBA class (ORB) has the explaining comment both in the standard abstract API class [7] and implementation [8]. In the Yoko project, used by Harmony [9], the majority of methods both in the standard declaration [10] and implementing class [11] were not documented (at the end of October, 2006). Also, GNU Classpath supported both older and current CORBA features (same as Sun's implementation). Harmony, differently, left the central method of the older standard (ORB.connect(Object)) fully unimplemented.


A complete implementation of the Java platform also requires a compiler that translates Java source code into bytecodes, a program that manages JAR files, a debugger, and an applet viewer and web browser plugin, to name a few. Harmony currently has the compiler, appletviewer, jarsigner, javah, javap, keytool, policytool, and unpack200 [12].

Virtual machine support

Harmony currently has seven virtual machine implementations that run Harmony Class Library, all of which were donations by external groups:

In the end of November, 2006, the language support provided by these virtual machine was still incomplete, and the build instructions recommended to use IBM's proprietary J9 instead to run the class library test suite. However, this is not necessary anymore (as of July 2007). The DRLVM virtual machine is currently (as of July 2006) under heavy development, so a fast improvement of its features can be expected.

Applications status

Since its conception, Harmony has steadily grown in its ability to execute non-trivial Java applications (see here). As of July 2007, supported applications include:

However, Harmony's incomplete library prevents it from launching some other applications:

  • ArgoUML: because it requires a Java applet implementation, which is still not available in Harmony.
  • Apache Geronimo runs on Apache Harmony with some issues and workarounds [19].
  • Vuze, formerly Azureus, because of unimplemented security classes.

See also


  1. Mark Wielaard (2006-05-24). "Toward a free Java". LWN.net. http://lwn.net/Articles/184967/. 
  2. "GNU Classpath License". http://www.gnu.org/software/classpath/license.html. 
  3. Dalibor Topic (2006-06-01). "Harmony, JavaONE 2007 and other thoughts". http://developer.classpath.org/pipermail/classpath/2006-June/000965.html. 
  4. Open Letter to Sun Microsystems
  5. According to ASF, 1) a specification lead cannot impose any contractual condition or covenant that would limit or restrict the right of any licensee to create or distribute such Independent Implementations (section 5.C.III), and 2) a specification lead must license all necessary IP royalty-free to any compatible implementation of a specification (section 5.B).
  6. Gilbert, Dave (2007-04-16). "Five Reasons Why Apache Will Regret That Open Letter". http://jroller.com/page/dgilbert?entry=five_reasons_why_apache_will. Retrieved 2008-03-08. 
  7. "OPENJDK COMMUNITY TCK LICENSE AGREEMENT V 1.1" (PDF). Sun Microsystems. http://openjdk.java.net/legal/openjdk-tck-license.pdf. Retrieved 2008-03-08. "Subject to and conditioned upon its Licensee Implementation being substantially derived from OpenJDK Code and, if such Implementation has or is to be distributed to a third party, its being distributed under the GPL License, Sun hereby grants to Licensee, to the extent of Sun's Intellectual Property Rights in the TCK, a worldwide, personal, non-exclusive, non-transferable, limited license to use the TCK internally and solely for the purpose of developing and testing Licensee Implementation." 
  8. "Google's Android SDK Bypasses Java ME in Favor of Java Lite and Apache Harmon". infoq.com. 2007-11-12. http://www.infoq.com/news/2007/11/android-java. Retrieved 2009-05-31. "Instead of providing a full version of the Java SE or Java ME Google has diverged on two fronts. First, a limited subset of the core Java packages is provided. (...) By going this route Android is following in the footsteps of another Google project GWT which uses Java as its development language but does not support the full JDK." 
  9. "Package Index". Open Handset Alliance. http://developer.android.com/reference/packages.html. Retrieved 2009-05-31. 
  10. Leo Simons (2006-07-24). ""We would like all the development to happen right here"". http://article.gmane.org/gmane.comp.java.harmony.devel/10742. 
  11. "The Apache Way". http://incubator.apache.org/learn/theapacheway.html. 
  12. "List of Apache Harmony Committers". http://incubator.apache.org/harmony/contributors.html. 
  13. Apache Harmony supported platforms and operating systems
  14. that a class is implemented does not imply that this class behaves as requested in the RI but the empty declaration is not an implemented method - some core functionality must be present. GNU Classpath uses special class of exception to mark stubs and do not count them as implemented methods
  15. Apache Harmony Library Coverage against Java SE 5.0
  16. BEA JRockit VM under a binary, evaluation-only license
  17. Announcing Jikes RVM 3.0 + Apache Harmony
  18. Ja.NET SE an open source project is providing a Java 5 JDK running on the .NET CLR
  19. Running Geronimo on Harmony

External links

Template:Java Virtual Machine Template:Java (Sun)

de:Apache Harmony

ja:Apache Harmony ru:Apache Harmony

zh:Apache Harmony
Personal tools

Served in 0.915 secs.