felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Felix > 3. Installation
Date Tue, 22 Sep 2009 16:03:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=FELIX&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/FELIX/3.+Installation">3.
Installation</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~gnodet">Guillaume
Nodet</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
class='ScrollbarPrevIcon'><a href="/confluence/display/FELIX/2.+Overview"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/FELIX/2.+Overview">2.
Overview</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/FELIX/Karaf+Users%27+Guide"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/FELIX/Karaf+Users%27+Guide">Karaf Users' Guide</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/FELIX/4.+Understanding+Karaf">4.
Understanding Karaf</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/FELIX/4.+Understanding+Karaf"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
<p><a name="3.Installation-top"></a></p>

<h1><a name="3.Installation-3.Installation"></a>3. Installation</h1>

<p>This document describes how to install and configure Apache Felix Karaf for both
Unix and Windows' platforms.<br/>
Here you will find information about what are pre requisite software, where to download Karaf
from and how to customize the installation to use custom ports other than the defaults.</p>

<p>This article contains the following sections:</p>
<div>
<ul>
    <li><a href='#3.Installation-PreInstallationRequirements'>Pre-Installation
Requirements</a></li>
    <li><a href='#3.Installation-InstallationProcedureforWindows'>Installation
Procedure for Windows</a></li>
<ul>
    <li><a href='#3.Installation-WindowsBinaryInstallation'>Windows Binary Installation</a></li>
    <li><a href='#3.Installation-WindowsSourceInstallation'>Windows Source Installation</a></li>
</ul>
    <li><a href='#3.Installation-InstallationProcedureForUnix'>Installation Procedure
For Unix</a></li>
<ul>
    <li><a href='#3.Installation-UnixBinaryInstallation'>Unix Binary Installation</a></li>
    <li><a href='#3.Installation-UnixSourceInstallation'>Unix Source Installation</a></li>
</ul>
    <li><a href='#3.Installation-StartingKaraf'>Starting Karaf</a></li>
<ul>
    <li><a href='#3.Installation-OnWindows'>On Windows</a></li>
    <li><a href='#3.Installation-OnUnix'>On Unix</a></li>
</ul>
    <li><a href='#3.Installation-TestingtheInstallation'>Testing the Installation</a></li>
    <li><a href='#3.Installation-StoppingKaraf'>Stopping Karaf</a></li>
</ul></div>

<h2><a name="3.Installation-PreInstallationRequirements"></a>Pre-Installation
Requirements</h2>

<p><b>Hardware:</b></p>
<ul>
	<li>5 MB of free disk space for the Apache Felix Karaf x.y binary distribution.</li>
	<li>3 MB of free disk space for the Apache Felix Karaf x.y source distributions or
SVN checkout. The Maven build requires roughly 57 MB disk space and for the dependencies Maven
downloads during building further 76 MB are required. As a lot of small files are produced,
the exact space demands depend greatly on your cluster utilization ratio.</li>
</ul>


<p><b>Operating Systems:</b></p>
<ul>
	<li>Windows: Windows XP SP2, Windows 2000.</li>
	<li>Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, any Unix platform
that supports Java.</li>
</ul>


<p><b>Environment:</b></p>
<ul>
	<li>Java Developer Kit (JDK) 1.5.x or greater (<a href="http://java.sun.com/" rel="nofollow">http://java.sun.com/</a>).</li>
	<li>The JAVA_HOME environment variable must be set to the directory where the JDK is
installed, e.g., <tt>c:\Program Files\jdk.1.5.0_06</tt>. To accomplish that, press
Windows key and Break key together, switch to "Advanced" tab and click on "Environment Variables".
Here, check for the variable and, if necessary, add it.</li>
	<li>Apache Maven 2.0.8 (<a href="http://maven.apache.org/download.html" rel="nofollow">http://maven.apache.org/download.html</a>).</li>
</ul>


<h2><a name="3.Installation-InstallationProcedureforWindows"></a>Installation
Procedure for Windows</h2>

<p>This section of the Getting Started guide explains how to install binary and source
distributions of Karaf on a Windows system.</p>
<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16"
align="absmiddle" alt="" border="0"></td><td><b>Handy Hint</b><br
/><p>In case you have to install Karaf into a very deep path or a path containing
illegal characters for Java paths, e.g. &#33;, % etc., you may add a bat file to <em>start
&#45;&gt; startup</em> that executes</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>subst S: "C:\your very % problematic path!\KARAF"
</pre>
</div></div>
<p>so your Karaf root directory is S: &#8212; which works for sure and is short
to type.</p></td></tr></table></div>

<h3><a name="3.Installation-WindowsBinaryInstallation"></a>Windows Binary
Installation</h3>

<p>This procedure explains how to download and install the binary distribution on a
Windows system.</p>
<ol>
	<li>From a browser, navigate to <a href="http://felix.apache.org/site/downloads.cgi"
rel="nofollow">http://felix.apache.org/site/downloads.cgi</a>.</li>
	<li>Scroll down to the "Apache Felix Karaf" section and select the desired distribution.<br/>
For a binary distribution, the filename will be similar to: <tt>apache-felix-karaf-x.y.zip</tt>.</li>
	<li>Extract the files from the ZIP file into a directory of your choice. Please remember
the restrictions concerning illegal characters in Java paths, e.g. &#33;, % etc.</li>
	<li>Proceed to the <a href="#3.Installation-StartingKaraf">Starting Karaf</a>
section of this document.</li>
	<li>Following start-up, go to the <a href="#3.Installation-TestingtheInstallation">Testing
the Installation</a> section of this document.</li>
	<li>Optional: see <a href="/confluence/display/FELIX/7.1.+Enabling+Colorized+Console+Output+On+Windows"
title="7.1. Enabling Colorized Console Output On Windows">7.1. Enabling Colorized Console
Output On Windows</a></li>
</ol>


<h3><a name="3.Installation-WindowsSourceInstallation"></a>Windows Source
Installation</h3>

<p>This procedure explains how to download and install the source distribution on a
Windows system. <b>NOTE:</b> Karaf requires Java 5 is compile, build and run.</p>
<ol>
	<li>From a browser, navigate to <a href="http://felix.apache.org/site/downloads.cgi"
rel="nofollow">http://felix.apache.org/site/downloads.cgi</a>.</li>
	<li>Scroll down to the "Apache Felix Karaf" section and select the desired distribution.<br/>
For a source distribution, the filename will be similar to: <tt>apache-felix-karaf-x.y-src.zip</tt>.</li>
	<li>Extract Karaf from the ZIP file into a directory of your choice. Please remember
the restrictions concerning illegal characters in Java paths, e.g. &#33;, % etc.</li>
	<li><a name="3.Installation-WindowsSourceInstallation"></a> Build Karaf
using Maven 2.0.8 or greater and Java 5.<br/>
The recommended method of building Karaf is the following:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd [karaf_install_dir]\\src
</pre>
</div></div>
<p> where <tt>[karaf_install_dir]</tt> is the directory in which Karaf was
installed.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn
</pre>
</div></div>
<p>Both steps take around 10 to 15 minutes.</p></li>
	<li>Unzip the distribution using your favorite zip tool. The windows distribution is
available at
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
[karaf_install_dir]\assembly\target\apache-felix-karaf-x.y.zip
</pre>
</div></div></li>
	<li>Proceed to the <a href="#3.Installation-StartingKaraf">Starting Karaf</a>
section of this document.</li>
	<li>Following start-up, go to the <a href="#3.Installation-TestingtheInstallation">Testing
the Installation</a> section of this document.</li>
	<li>Optional: see <a href="/confluence/display/FELIX/7.1.+Enabling+Colorized+Console+Output+On+Windows"
title="7.1. Enabling Colorized Console Output On Windows">7.1. Enabling Colorized Console
Output On Windows</a></li>
</ol>


<h2><a name="3.Installation-InstallationProcedureForUnix"></a>Installation
Procedure For Unix</h2>

<h3><a name="3.Installation-UnixBinaryInstallation"></a>Unix Binary Installation</h3>

<p>This procedure explains how to download and install the binary distribution on a
Unix system.</p>
<ol>
	<li>From a browser, navigate to <a href="http://felix.apache.org/site/downloads.cgi"
rel="nofollow">http://felix.apache.org/site/downloads.cgi</a>.</li>
	<li>Scroll down to the "Apache Felix Karaf" section and select the desired distribution.<br/>
For a binary Unix distribution, the filename will be similar to: apache-felix-karaf-x.y.tar.gz.</li>
	<li>Extract the files from the gzip file into a directory of your choice. For example:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
gunzip apache-felix-karaf-x.y.tar.gz
tar xvf apache-felix-karaf-x.y.tar
</pre>
</div></div>
<p>Please remember the restrictions concerning illegal characters in Java paths, e.g.
&#33;, % etc.</p></li>
	<li>Proceed to the <a href="#3.Installation-StartingKaraf">Starting Karaf</a>
section of this document.</li>
	<li>Following start-up, go to the <a href="#3.Installation-TestingtheInstallation">Testing
the Installation</a> section.</li>
</ol>


<h3><a name="3.Installation-UnixSourceInstallation"></a>Unix Source Installation</h3>

<p>This procedure explains how to download and install the source distribution on a
Unix system. This procedure assumes the Unix machine has a browser. Please see the previous
<a href="#3.Installation-UnixBinaryInstallation">Unix Binary Installation</a>
section for ideas on how to install Karaf without a browser. <b>NOTE:</b> Karaf
requires Java 5 to compile, build and run.</p>
<ol>
	<li>From a browser, navigate to <a href="http://felix.apache.org/site/downloads.cgi"
rel="nofollow">http://felix.apache.org/site/downloads.cgi</a>.</li>
	<li>Scroll down to the "Apache Felix Karaf" section and select the desired distribution.<br/>
For a source distribution, the filename will be similar to: <tt>apache-felix-karaf-x.y-src.tar.gz</tt>.</li>
	<li>Extract the files from the ZIP file into a directory of your choice. For example:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
gunzip apache-felix-karaf-x.y-src.tar.gz
tar xvf apache-felix-karaf-x.y-src.tar
</pre>
</div></div>
<p>Please remember the restrictions concerning illegal characters in Java paths, e.g.
&#33;, % etc.</p></li>
	<li>Build Karaf using Maven 2.0.8 or greater and Java 5:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
The preferred method of building Karaf is the following:
cd [karaf_install_dir]/src
 where [karaf_install_dir] is the directory in which Karaf was installed.
mvn
</pre>
</div></div></li>
	<li>Uncompress the distribution that has just been created
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd [karaf_install_dir]/assembly/target
gunzip apache-felix-karaf-x.y.tar.gz
tar xvf apache-felix-karaf-x.y.tar
</pre>
</div></div></li>
	<li>Proceed to the <a href="#3.Installation-StartingKaraf">Starting Karaf</a>
section of this document.</li>
	<li>Following start-up, go to the <a href="#3.Installation-TestingtheInstallation">Testing
the Installation</a> section.</li>
</ol>



<h2><a name="3.Installation-StartingKaraf"></a>Starting Karaf</h2>


<h3><a name="3.Installation-OnWindows"></a>On Windows</h3>

<p>From a console window, change to the installation directory and run <tt>Karaf</tt>.
For the binary distribution, go to</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd [karaf_install_dir]
</pre>
</div></div>
<p>and for the source distribution go to the target directory, for example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd [karaf_install_dir]\src\assembly\target\apache-felix-karaf-x.y-SNAPSHOT
</pre>
</div></div>
<p>where <tt>karaf_install_dir</tt> is the directory in which Karaf was
installed, e.g., <tt>c:\Program Files\apache-felix-karaf-x.y</tt>.</p>

<p>Then type:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
bin\karaf.bat
</pre>
</div></div>
<p><em>Note:</em> Working directories get created relative to the current
directory. For the working directories to be created in the proper place, Karaf must be launched
from its home/installation directory.</p>

<h3><a name="3.Installation-OnUnix"></a>On Unix</h3>

<p>From a command shell, change to the installation directory and run <tt>Karaf</tt>.
For the binary distribution, go to</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd [karaf_install_dir]
</pre>
</div></div>
<p>and for the source distribution go to the target directory, for example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cd [karaf_install_dir]/src/assembly/target/apache-felix-karaf-x.y
</pre>
</div></div>
<p>where <tt>karaf_install_dir</tt> is the directory in which Karaf was
installed, e.g., <tt>/usr/local/apache-felix-karaf-x.y</tt>.</p>

<p>Then type:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
bin/karaf.sh
</pre>
</div></div>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/forbidden.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Warning</b><br
/><p>Do NOT close the console or shell in which Karaf was started, as that will terminate
Karaf (unless Karaf was started with nohup).</p></td></tr></table></div>

<h2><a name="3.Installation-TestingtheInstallation"></a>Testing the Installation</h2>

<p>If Karaf is up and running without problems, the Window's console window or the Unix
command shell will display something similar to the following log line:</p>
<div class="panel" style="background-color: #000000;border-width: 1px;"><div class="panelContent"
style="background-color: #000000;">
<p><font color="#00ffff"><pre>        __ __                  ____      
       / //_/____ __________ _/ __/      
      / ,&lt;  / __ `/ ___/ __ `/ /_        
     / /| |/ /_/ / /  / /_/ / __/        
    /_/ |_|\__,_/_/   \__,_/_/         

</pre></font><font color="#c0c0c0"><pre>  Apache Felix Karaf (1.0.0)

Hit '&lt;tab&gt;' for a list of available commands
and '[cmd] --help' for help on a specific command.

karaf@root&gt; 
</pre></font></p>
</div></div>

<h2><a name="3.Installation-StoppingKaraf"></a>Stopping Karaf</h2>

<p>For both Windows and Unix installations, you can perform a clean shutdown of Karaf
Kernel by using the following command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
osgi:shutdown
</pre>
</div></div>

<p>If Karaf was started in the background on Unix, the process can be killed, with the
following:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
ps -ef | grep karaf
kill [PID]
 where [PID] is the process id of the Karaf process.
</pre>
</div></div>

<p><a href="#3.Installation-top">top</a></p>
<style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
class='ScrollbarPrevIcon'><a href="/confluence/display/FELIX/2.+Overview"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/FELIX/2.+Overview">2.
Overview</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/FELIX/Karaf+Users%27+Guide"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/FELIX/Karaf+Users%27+Guide">Karaf Users' Guide</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/FELIX/4.+Understanding+Karaf">4.
Understanding Karaf</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/FELIX/4.+Understanding+Karaf"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/FELIX/3.+Installation">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=74690&revisedVersion=21&originalVersion=20">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/FELIX/3.+Installation?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message