Apache Harmony is retired at the Apache Software Foundation since Nov 16, 2011.

The information on these pages may be out of date, or may refer to resources that have moved or have been made read-only.
For more information please refer to the Apache Attic

Getting Started For Users

The current document provides basic instructions for people that wish to use Apache Harmony for running their Java programs. The steps described below neither require development tools nor necessitate compiling source code.

For more information on how to get you machine configured to build and work with the Apache Harmony source code, refer to Getting Started For Contributors.

The required dependencies are listed below per platform.

Download the Apache Harmony Snapshot

First, download the binary distribution appropriate to your platform. We currently distribute binaries for Linux and Microsoft Windows. Please follow the instructions on the download page to choose and download the software.

Currently, the Apache Harmony project has no formal releases of its software. Instead, the project offers pre-built snapshots that are expected to run well on the platforms offered.

Unpack the Binary Distribution

Once you have obtained the appropriate binary distribution, you need to unpack it on your machine. In all cases, the distribution will unpack into a jre directory. Further in the document we refer to this directory as the root directory of the distribution.

Linux Users
Use the tar program as follows:
$ tar -tzf latest-harmony-jre-linux.tar.gz
This will unpack the JRE directory tree into the current directory.
Windows Users
Use one of zip utilities available for Windows to unpack the distribution. The three popular ones are listed below, but anything that can handle a zip file will work:
To create the JRE directory tree, extract the distribution zip file using the utility.

Configuring Your Environment

Apache Harmony requires no further environmental setup, but sometimes other programs do. Also, it is convenient to have the Apache Harmony executables on your path.

To set your JAVA_HOME and PATH environment variables, use the commands appropriate to your operating system and/or shell you are using.

Linux Users
The following command works for the Bash shell:
$ cd jre
$ export JAVA_HOME=`pwd`
$ cd bin
$ export PATH=`pwd`:$PATH
The given command assumes your current directory is the parent directory of the Harmony JRE.

Note

The ` character is a backtick character, not an apostrophe.

Windows Users
The following example assumes you unpacked the zip file into the root directory C:\. Please adjust as necessary.
C:\> set JAVA_HOME=C:\jre
C:\> set PATH=C:\jre\bin;%PATH%

Using Apache Harmony

After performing aforementioned steps, you should be ready to use Apache Harmony. Try running your Java application:

$ java Foo
$ java -jar myjar.jar

In addition to standard options, you can use custom command-line options to adjust operation of the VM.

Back to top