UIMA SDK Setup for Eclipse

This chapter describes how to set up the UIMA SDK to work with Eclipse. Eclipse (http://www.eclipse.org) is a popular open-source Integrated Development Environment for many things, including Java. The UIMA SDK does not require that you use Eclipse. However, we recommend that you do use Eclipse because some useful UIMA SDK tools run as plug-ins to the Eclipse platform and because the UIMA SDK examples are provided in a form that's easy to import into your Eclipse environment.

If you are not planning on using the UIMA SDK with Eclipse, you may skip this chapter and read Chapter 4, Annotator and Analysis Engine Developer’s Guide next.

This chapter provides instructions for

  • installing Eclipse,
  • installing the UIMA SDK's Eclipse plugins into your Eclipse environment, and
  • importing the example UIMA code into an Eclipse project.

The UIMA Eclipse plugins are designed to be used with Eclipse version 3.

Install Eclipse

  • Go to http://download.eclipse.org/downloads
  • We recommend using the latest release level (not an "Integration level'). Navigate to the Eclipse Release version you want and download the archive for your platform.
  • Unzip the archive to install Eclipse somewhere, e.g., c:\
  • Eclipse has a bit of a learning curve. If you plan to make significant use of Eclipse, check out the tutorial under the help menu. It is well worth the effort.

Install EMF

EMF stands for Eclipse Modeling Framework. It is an add-on to Eclipse, and is used by the UIMA Eclipse tooling. Use the built-in facilities in Eclipse to find and install new features.

Activate the software feature finding by using the menu: help >> Software Updates >> Find and Install. Select "Search for new features to install", push "Next". Specify the update site where EMF is found as a site to search, making sure the "Ignore features not applicable to this environment" box is checked, and push "Finish". You can find out where this site is by going to http://www.eclipse.org and browsing for EMF. In early 2006, the EMF update site was http://download.eclipse.org/tools/emf/updates. If your computer is on an internet connection which uses a proxy server, you can configure Eclipse to know about that. Put your proxy settings into Ecluse using the Eclipse preferences by accessing the menus: Window => Preferences... => Install/Update, and Enable HTTP proxy connection under the Proxy Settings with the information about your proxy.

This will launch a search for updates to Eclipse; it may show a list of update site mirrors – click OK. When it finishes, it shows a list of possible updates in an expandable tree. Expand the tree nodes to find EMF SDK. The specific level may vary from the level shown below as newer versions are released.

Click "Next". Then pick Eclipse Modeling Framework (EMF), and push "Next", accept any licensing agreements, etc., until it finishes the installation. It may say it's an "unsigned feature"; proceed by clicking "Install". If it recommends restarting, you may do that.

This will install EMF, without any extras. (If you want the whole EMF system, including source and documentation, you can pick the "EMF SDK" and the "Examples for Eclipse Modeling Framework".)

Install the UIMA SDK

If you haven't already done so, please download and install the UIMA SDK from http://www.alphaworks.ibm.com/tech/uima.

Install the UIMA Eclipse Plugins

In the directory %UIMA_HOME%/eclipsePlugin, you will find a zip file. (The environment variable %UIMA_HOME% is where you installed the UIMA SDK.) Unzip it into your %ECLIPSE_HOME%/eclipse/plugins directory. %ECLIPSE_HOME% is where you installed Eclipse.

Start Eclipse

If you have Eclipse running, restart it (shut it down, and start it again) using the clean option. Start Eclipse by running the command eclipse -clean (see explanation in the next section) in the directory where you installed Eclipse. You may want to set up a desktop shortcut at this point for Eclipse. Eclipse has a bit of a learning curve. If you plan to make significant use of Eclipse, check out the tutorial under the help menu. It is well worth the effort. There are also books you can get that describe Eclipse and its use.

The first time Eclipse starts up it will take a bit longer as it completes its installation. A "welcome" page will come up. After you are through reading the welcome information, click on the arrow in the upper right of the main panel to exit the welcome page and get to the main Eclipse screens.

Special startup parameter for Eclipse: -clean

If you have modified the plugin structure (by copying or unzipping files directly in the file system) in Eclipse 3.x after you started it for the first time, please include the "-clean" parameter in the startup arguments to Eclipse, one time (after any plugin modifications were done). This is needed because Eclipse may not notice the changes you made, otherwise. This parameter forces Eclipse to reexamine all of its plugins at startup and recompute any cached information about them.

Later chapters refer to example code. You can create a special project in Eclipse to hold the examples. Here's how:

  • In Eclipse, if the Java perspective is not already open, switch to it by going to Window –> Open Perspective –> Java.
  • Set up a class path variable named UIMA_HOME, whose value is the directory where you installed the UIMA SDK., This is done as follows:
    • Go to Window –> Preferences –> Java –> Build Path –> Classpath Variables.
    • Click "New"
    • Enter UIMA_HOME (all capitals, exactly as written) in the "Name" field.
    • Enter your installation directory (e.g. C:/Program Files/apache-uima) in the "Path" field
    • Click "OK" in the "New Variable Entry" dialog
    • Click "OK" in the "Preferences" dialog
    • If it asks you if you want to do a full build, click "Yes"
  • Select the File -> Import menu option
  • Select "Existing Project into Workspace" and click the "Next" button.
  • Click "Browse" and browse to the %UIMA_HOME%\docs\examples directory
  • Click "Finish." This will create a new project called "uima_examples" in your Eclipse workspace. There should be no compilation errors.

To verify that you have set up the project correctly, check that there are no error messages in the "Tasks" or "Problems" view.

You can run outside of Eclipse using the shell scripts in the UIMA SDK's bin directory. In addition, many tools can be run from inside Eclipse; examples are the Document Analyzer, CPE Configurator, CAS Visual Debugger, Semantic Search, and JCasGen. The uima_examples project provides Eclipse launch configurations that make this easy to do.

To run these tools from Eclipse:

  • If the Java perspective is not already open, switch to it by going to Window –> Open Perspective –> Java.
  • Go to Run –> Run...
  • In the window that appears, select "UIMA CPE GUI", "UIMA CAS Visual Debugger", "UIMA JCasGen", "UIMA Document Analyzer", or "UIMA Semantic Search" from the list of run configurations on the left. (If you don't see, these, please select the uima_examples project and do a Menu -> File -> Refresh).
  • Press the "Run" button. The tools should start. Close the tools by clicking the "X" in the upper right corner on the GUI.

For instructions on using the Document Analyzer and CPE Configurator, see Chapter 17, Document Analyzer User's Guide, and Chapter 13 . For instructions on using the CAS Visual Debugger and JCasGen, see Chapter 18, CAS Visual Debugger, and Chapter 19, JCasGen User Guide.