Compiling and Running Applications that Access JSON Tables and Documents

You can compile applications that use the MapR-DB JSON API by using the required JAR file from the MapR Maven repository or from the MapR installation. Run applications 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 maprdb 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