Installation

Apache Karaf is a lightweight container, very easy to install and administrate, on both Unix and Windows platforms.

Requirements

Hardware:

  • 50 MB of free disk space for the Apache Karaf binary distribution.

Operating Systems:

  • Windows: Windows 8, Windows 7, Windows 2003, Windows Vista, Windows XP SP2, Windows 2000.

  • Unix: RedHat Enterprise Linux, Debian, SuSE/OpenSuSE, CentOS, Fedora, Ubuntu, MacOS, AIX, HP-UX, Solaris, any Unix platform that supports Java.

Environment:

Using Apache Karaf binary distributions

Apache Karaf is available in two distributions, both as a tar.gz and zip archives.

The "default" distribution is a "ready to use" distribution. The "default" distribution provides the following features enabled.

The "minimal" distribution is like the minimal distributions that you can find for most of Unix distributions. Only the core layer is packaged, most of the features and bundles are downloaded from Internet at bootstrap. It means that Apache Karaf minimal distribution requires an Internet connection to start correctly. The features provided by the "minimal" distribution are exactly the same as in the "default" distribution, the difference is that the minimal distribution will download the features from Internet.

Installation on Windows platform
Note

The JAVA_HOME environment variable has to be correctly defined. To accomplish that, press Windows key and Break key together, switch to "Advanced" tab and click on "Environment Variables".

  1. From a browser, navigate to http://karaf.apache.org/index/community/download.html

  2. Download Apache Karaf binary distribution in the zip format: apache-karaf-3.0.0.zip.

  3. Extract the files from the zip file into a directory of your choice (it’s the KARAF_HOME)

Note

Remember the restrictions concerning illegal characters in Java paths, e.g. \!, % etc.

Note

In case you have to install Karaf into a very deep path or a path containing illegal characters for Java paths, e.g. \!, % etc., you may add a bat file to start -> startup that executes

subst S: "C:\your very % problematic path!\KARAF"

so your Karaf root directory is S: --- which works for sure and is short to type.

Installation on Unix platforms
Note

The JAVA_HOME environment variable has to be correctly defined. Check the current value using

echo $JAVA_HOME

If it’s not correct, fix it using:

export JAVA_HOME=....
  1. From a browser, navigate to http://karaf.apache.org/index/community/download.html

  2. Download Apache Karaf binary distribution in the tar.gz format: apache-karaf-3.0.0.tar.gz.

  3. Extract the files from the tar.gz file into a directory of your choice (it’s the KARAF_HOME). For example:

gunzip apache-karaf-3.0.0.tar.gz
tar xvf apache-karaf-3.0.0.tar
Note

Remember the restrictions concerning illegal characters in Java paths, e.g. \!, % etc.

Post-Installation steps

Thought it is not always required, it is strongly advised to set up the JAVA_HOME environment property to point to the JDK you want Apache Karaf to use before starting it. This property is used to locate the java executable and should be configured to point to the home directory of the Java SE 7 installation.

By default, all Apache Karaf files are "gather" in one directory: the KARAF_HOME.

You can define your own directory layout, by using some Karaf environment variables:

  • KARAF_DATA is the location of the data folder, where Karaf stores temporary files.

  • KARAF_ETC is the location of the etc folder, where Karaf stores configuration files.

  • KARAF_BASE is the Karaf base folder. By default KARAF_BASE is the same as KARAF_HOME.

Building from Sources

If you intend to build Apache Karaf from the sources, the requirements are a bit different:

Hardware:

  • 500 MB of free disk space for the Apache Karaf source distributions or SVN checkout, the Maven build and the dependencies Maven downloads.

Environment:

Building on Windows platform
  1. You can get the Apache Karaf sources from:

git clone https://git-wip-us.apache.org/repos/asf/karaf.git karaf
  1. Use Apache Maven to build Apache Karaf:

mvn clean install
Note

You can speed up the build by bypassing the unit tests:

mvn clean install -DskipTests
  1. You can find the built binary distribution in assemblies\apache-karaf\target\apache-karaf-3.0.0.zip. You can install and use it as explained in the "Using Apache Karaf binary distributions" section.

Building on Unix platforms
  1. You can get the Apache Karaf sources from:

git clone https://git-wip-us.apache.org/repos/asf/karaf.git karaf
  1. Use Apache Maven to build Apache Karaf:

mvn clean install
Note

You can speed up the build by bypassing the unit tests:

mvn clean install -DskipTests
  1. You can find the built binary distribution in assemblies/apache-karaf/target/apache-karaf-3.0.0.tar.gz. You can install and use it as explained in the "Using Apache Karaf binary distributions" section.