Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

This document will guide you through importing ServiceMix into the IDE Eclipse.

Pre-Installation Requirements

Hardware:

  • 52 MB of free disk space for the ServiceMix 3.x binary distribution.
  • 18 MB of free disk space for the ServiceMix 3.x source or developer's distributions.

Operating Systems:

  • Windows: Windows XP SP2, Windows 2000.
  • Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, any Unix platform that supports Java.

Environment:

  • Java Developer Kit (JDK) 1.5.x (Java 5) for compiling/building.
  • The JAVA_HOME environment variable must be set to the directory where the JDK is installed, e.g., c:\Program Files\jsdk.1.5.x
  • Maven 1.0.2 or greater.
  • Eclipse 3.x or greater.

Importing ServiceMix

Below are the steps to import ServiceMix as a project in Eclipse.

Preparing the Files for Eclipse

  1. Grab the sources from svn or download Download servicemix source distribution.
  2. From the command line execute the following Maven command to ready the project for Eclipse.
    Code Block
    
    maven 
    Put in the Eclipse tags:
    maven
    -Dmaven.test.skip=true default eclipse
    

In Eclipse:


  1. From the "File" menu select "Import". 
    Image Added
  2.  Select "Existing
    File>Import>Existing Projects into Workspace" and click "Next"
    Image Added
  3. Browse for the root directory, which is the directory in which you downloaded ServiceMix.  "Select all All" the files in the Import pop-up window. They are probably already pre-selected for you (check box is checked).
    Image Added
  4. Click "Finish" in the Import window.
  5. From the "Windows" menu and click "Preferences"Windows>Preferences
    The Preferences window will pop-up.
    Change to JDK 5
    Windows>preferences click on Compiler
    Compiler compliance level must be 5.0, pull down menu and select.
    Check the "Use default compliance settings" box.
    Image Added
    Then check under "Installed JREs" that you have JDK 5, e.g., jre_1.5.x
    Image Added
    Click Ok
  6. Click on the Java plus sign, then click on Build Path
    then select Classpath Variables.
    Image Added
  7. Click on New button to right
    A pop-up appears.
    Enter the Name: MAVEN_REPO
    Enter the Path, which is your local maven repository, usually located in
    your home directory .maven, for example:
    C:\Documents and Settings\Lisa Malgeri\.maven\repository
    Image Added

Running an Example

  1. Now you can run an example:
    a. In the Package Explorer find the Main class, which should be located in: servicemix-core/src/main/java/
    under org.apache.servicemix/Main.java.
    Double click on the main() class.
    Image Added
  2. From the Run menu select "Run..."
    Image Added Image Added
  3. You will get a Run window pop-up, from there select Java Application
  4. Click on New button in botton left
    Name the Project: any name you like, for example if you want to run the FilePoller application call it "filepoller".
  5. Click on arguments button:
  6. In the Program Arguments box enter servicemix.xml
  7. In the Working Directory enter the path of your example. Such as:
    C:\Program Files\servicemix-1.0.1\examples\file-binding
    You can use the "File System..." button to browse for your directory.
  8. Click Apply.
  9. Click Run