Running the sample REST API applications in Eclipse

You can run the sample REST API applications in an Eclipse environment.

Before you begin

Before you can run the sample REST API Java™ applications, you must install and configure Apache ANT, a Java-based build tool. For information about how to install and configure Apache ANT, see http://ant.apache.org/.

In addition, you must configure Eclipse to use a JRE Version 1.6 environment.

Procedure

To run the sample REST API applications in Eclipse:

  1. Create an Eclipse project and import the files from the ES_INSTALL_ROOT/samples/rest/admin directory.
  2. Right-click the project, click Properties, and click Java Build Path > Libraries > Add jars. Select es.admin.rest.jar as the JAR file to include.
  3. Right-click the project, click Properties, and click Java Build Path > Add external Archives. Select the following files from the ES_INSTALL_ROOT\lib\axis2 directory:
    • commons-codec-1.3.jar
    • commons-fileupload-1.2.jar
    • commons-httpclient-3.1
    • commons-io-1.4.jar
    • commons-logging-1.1.1.jar
  4. To run the application, right-click the project and click Run as > Run Configurations.
  5. Click the Arguments tab and type the command arguments for the REST API sample.
  6. Click Run.