Building Java Applications that Use the MapR Streams API Library

You can compile and run a Java application that uses the required JAR file from the MapR Maven repository or from the MapR installation.

Using the JAR File from the MapR Maven Repository

  1. Add MapR's Maven repository to your pom.xml file, if it is not already added:
        <repositories>
        <repository>
          <id>mapr-releases</id>
          <url>http://repository.mapr.com/nexus/content/repositories/releases</url>
          <snapshots><enabled>true</enabled></snapshots>
          <releases><enabled>true</enabled></releases>
        </repository>
      </repositories>
  2. Add a dependency to the mapr-streams project:
        <dependency>
          <groupId>com.mapr.streams</groupId>
          <artifactId>mapr-streams</artifactId>
          <version>5.2.0-mapr</version>
        </dependency>

Using JARs from the MapR Installation

  • Use the following command to compile applications:
    javac -cp `mapr classpath` <Application jars>
  • Use the following command to run applications:
    java -cp `mapr classpath`:. <Main class jar> <commandline arguments>