Anzo Java SDK
This topic provides instructions for setting up an Anzo development environment using the Anzo software development kit (SDK) and Eclipse integrated development environment (IDE). The sample instructions below deploy the Anzo SDK in a Windows environment with Eclipse IDE for Java Developers Version 4.12.0. Anzo SDK and Eclipse can also be deployed on Linux and Mac operating systems.
Requirements
Make sure that the Anzo development server meets the requirements in Anzo Server Requirements. In addition, install the following programs for working with the Anzo Java SDK:
- Eclipse for Java Developers Version 4.7.3+: Install the Eclipse IDE for Java Developers or Eclipse IDE for Enterprise Java Developers.
- Java Runtime Environment Version 8: Eclipse and the Anzo SDK require JDK version 8. Cambridge Semantics tests with jdk1.8.0_181.
Deploying the Anzo SDK with Eclipse
Follow the instructions below to import the Anzo Java SDK to Eclipse and configure and test the environment.
- Download the Anzo SDK .zip file to the host server. Do not unpack the file.
- In Eclipse, click the File menu and select Import. Eclipse opens the Import dialog box. For example:
- In the Import dialog box, expand the General folder and select Existing Projects into Workspace and click Next. Eclipse opens the Import Projects dialog box. For example:
- Select the Select archive file radio button and then browse to and select the Anzo SDK .zip file. Eclipse loads the .zip file and lists the contents in the Projects field. For example:
The Anzo SDK contains three projects:
- com.cambridgesemantics.anzo.sdk: This core project is required for creating solutions. It contains the Anzo libraries that provide the Anzo APIs and extension points as well as the libraries that enable Anzo to run in the development environment.
- com.cambridgesemantics.anzo.sdk.server This core project is required for creating solutions. It contains configuration files for running Anzo as well as a launcher for starting the Anzo server.
- com.cambridgesemantics.anzo.sdk.api: This is an example project that contains sample Java programs that illustrate several aspects of the Anzo client APIs. Each program is a simple example that demonstrates how to communicate with the Anzo server to read, write, and query data. See the comments in each example for an explanation of what each one demonstrates.
- Click Finish to import the Anzo SDK .jar files. The process may take a few minutes. When the import is complete, Eclipse opens the workspace. At this point in the process, expect to see several errors in the workspace. For example:
- Import your Anzo license:
- Make sure that you have a copy of the Anzo license on the server. If necessary, you can view and download a copy from the Cambridge Semantics Support Center.
- Rename the license file so its file extension is .lic. For example, license.lic.
- In the Eclipse Package Explorer, right-click com.cambridgesemantics.anzo.sdk.server and select Import.
- In the Import dialog box, expand the General folder and select File System. Then click Next. Eclipse opens the File System Import dialog box. For example:
- Click the Browse button next to the From directory field and select the directory that contains the license file. Eclipse displays the directory and its contents.
- Select the license file in the right pane, and then click Finish.
- Install the Eclipse Plugin Development Tools:
- Click the Help menu and select Install New Software. Eclipse opens the Install dialog box.
- In the Install dialog box, click the Work with drop-down list and select All Available Sites. In the search field below the Work with field, type "PDE" and wait for Eclipse to find the plugin tools. Select the checkbox next to Eclipse Plugin Development Tools, including Eclipse PDE Plug-in Developer Resources. For example:
- Click Next and accept the license agreement, then click Finish. Eclipse installs the software and then prompts you to restart the application.
- After restarting Eclipse, load the Anzo SDK Target Platform:
- Click the Window menu and select Preferences.
- In the Preferences dialog box, expand Plug-in Development and select Target Platform.
- In the Target Platform definitions, select the Anzo SDK Devel Target checkbox. For example:
- Click Apply and Close. Eclipse loads the Anzo SDK Target Platform.
- Test the environment:
- In the Eclipse workspace, click the Run menu and select Run Configurations. Eclipse opens the Run Configurations dialog box.
- On the left side of the dialog box, expand the OSGi Framework folder and select Anzo (SDK). For example:
- Click Run to run the Anzo SDK target platform. A Console tab opens in Eclipse and shows the status messages. When Anzo starts, the console displays the message "All Currently Registered Services started." For example:
If Anzo fails to start, one of the common reasons for the failure is that one or more of the Anzo ports are in use by other software. See Firewall Requirements for information about the ports that Anzo uses.
To explore the sample Java programs that are included in the Anzo SDK, expand the com.cambridgesemantics.anzo.sdk.api package in the Package Explorer. In the package, expand the src directory and then the com.cambridgesemantics.anzo.sdk.api directory to see the list of sample programs. For example:
To run a program, right-click the .java file and select Run As > Java Application. For more information about using the Anzo SDK, see the Anzo Java SDK Guide.pdf that is distributed in the SDK .zip file.