Skip to main content

Obtaining and Installing the AMPS Java Client

Prerequisites

Before proceeding with this guide, make sure that the following programs are installed and functioning properly on your development machine:

  • Java Development Kit version 1.7 or greater
  • Java Runtime Environment version 1.7 or greater
  • Apache Ant version 1.8 or greater (optional)

Obtaining the Client

The AMPS Java client can be installed from the Maven Central Repository using com.crankuptheamps as the groupId and amps-client as the artifactId for the package coordinates.

The AMPS Java client source code and pre-compiled JARs are also available in the AMPS Java client distribution on the 60East Technologies website.

The pre-compiled JAR files are located in the dist/lib/ directory, which contains the following JAR files:

  • amps_client.jar contains the com.crankuptheamps.client package, which includes the classes necessary to build an AMPS client. This JAR and its contents will be discussed throughout this Developer Guide.
  • amps_client-sources.jar contains the source code files used to create the Java implementation of the AMPS client libraries. This file can be included in an IDE to assist in debugging. It can also be used to rebuild the AMPS client libraries if any custom changes are necessary. See Rebuilding the Client for instructions on how to recompile the AMPS Java client source.
  • amps_client-javadoc.jar, like the amps_client-sources.jar, can be included in an IDE to provide the javadoc annotations for the implemented classes and methods.

Test Connectivity to AMPS

Before writing programs in AMPS, make sure connectivity to your AMPS development instance is working from your AMPS development environment.

Launch a terminal window and change the directory to the AMPS directory in your AMPS server installation and use spark to test connectivity to your server.

For example:

./bin/spark ping -server localhost:9007/amps/json

This uses the spark utility included with the AMPS server to test connectivity to an AMPS server instance running on localhost port 9007 using the amps protocol and the json message type.

If the AMPS instance you will use for development is running on a different host or port, you can adjust the hostname, port, and message type to match the values you intend to use in your application.

For information on setting up an AMPS development environment, see the Getting Started with AMPS section in the AMPS Introduction.