MapR 5.0 Documentation : Building and Launching Applications


  • Verify that mapr-client is installed on the node. The mapr-client package must be installed on each node that builds an application. The libhbase header files are in this directory: /opt/mapr/include/hbase
  • Verify that both the libMapRClient library and libjvm shared libraries are in the application’s library search path. The libMapRClient library is located in this directory: /opt/mapr/lib

Building Applications

When building applications that use the MapR version of libhbase, run this command:

gcc -o <application_name> <source_file> -I/opt/mapr/include/hbase -L/opt/mapr/lib/ -lMapRClient -L/usr/lib/jvm/java-7-sun/jre/lib/amd64/server -ljvm

For example, the following command builds the hello_hbase application with the hello_hbase.c source code:

gcc -o hello_hbase hello_hbase.c -I/opt/mapr/include/hbase -L/opt/mapr/lib/ -lMapRClient -L/usr/lib/jvm/java-7-sun/jre/lib/amd64/server -ljvm

The libMapRClient library has dependencies on libjvm, though a JVM is not instantiated. In general, the libjvm library is located within the JDK/JRE installation directory.

Launching Applications

Before launching an application, set this value for the environment variable LD_LIBRARY_PATH:


If the client is on Windows, append the following directories to the PATH environment variable:

  • $MAPR_HOME/lib
  • $JAVA_HOME/bin/server

If the application uses the hb_connection_create_as_user API for impersonation, set the MAPR_IMPERSONATION_ENABLED environment variable to true.

You can now launch the application.