Compiling and Launching Producers and Consumers

You can compile producers and consumers by using the required JAR file from the MapR Maven repository or from the MapR installation. Launch producers and consumers with the mapr command.

Using the JAR File from the MapR Maven Repository
Note: This method works only if your MapR cluster is not secure.
  1. Add MapR's Maven repository to your pom.xml file, if it is not already added:
  2. Add a dependency to the kafka-clients project:
Using JARs from the MapR Installation
Use the following command to compile applications:
javac -cp `mapr classpath` <Application jars>

Launching Applications

Use the following command to launch applications:
mapr <Main class jar> <commandline arguments>
Note: If you want to add JAR files to the classpath that the mapr command uses, add them with the environment variable MAPR_CLASSPATH.


export MAPR_CLASSPATH=/home/apps/awesome-1.0.jar