Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

GHA build status PMEMKV-JAVA version pmemkv-root maven central


Java bindings for pmemkv, using Java Native Interface. It's mostly functionally equal to pmemkv in version 1.0, but some of the new functionalities (e.g. from pmemkv 1.4) are already available.

All known issues and limitations are logged as GitHub issues or are described in pmemkv's man pages.

Java API is documented with javadocs and can be found as html on for every branch/release. For most recent always see master docs.

Latest releases can be found on the "releases" tab. Up-to-date support/maintenance status of branches/releases is available on


  • pmemkv 1.4 - Key-Value Datastore for Persistent Memory
    • pmemkv source package (pmemkv-devel or libpmemkv-dev)
  • Java Development Kit 8
  • gcc-c++ compiler
  • Apache Maven 3 - build system


Maven repository

This pmemkv binding is accesible from maven repository:

io.pmem namespace @

You can add our project as a dependency and use it freely. Make sure to use it e.g. like this:



Start by installing pmemkv (currently at least in version 1.4) in your system. Make sure our helper library pmemkv_json_config is enabled by specifying extra cmake parameter - cmake .. -DBUILD_JSON_CONFIG=ON ....

It may be necessary to configure a proxy and set JAVA_HOME environment variable. Set JAVA_HOME variable with directory containing JDK 8 installed typically in /usr/lib/jvm/, command below will set first directory matching to 1.8.0, but path can differ in some exotic distros:

export JAVA_HOME=`ls -d1 /usr/lib/jvm/* | grep "1.8.0" | head -n 1`

Clone the pmemkv-java tree:

git clone
cd pmemkv-java

Build and install Java Native Interface (JNI) and java bindings:

mvn install

If dependencies (pmemkv, libpmemobj-cpp, pmdk, etc.) are installed in non-standard location(s) it may be also necessary to set up: CPLUS_INCLUDE_PATH and LIBRARY_PATH for compiling and linking JNI code (gcc env. variables), LD_LIBRARY_PATH for examples and tests build/execution.

CPLUS_INCLUDE_PATH=<path_to_includes> \
LIBRARY_PATH=<path_to_libs> \
LD_LIBRARY_PATH=<path_to_libs> mvn install


This library includes a set of automated tests that exercise all functionality.

LD_LIBRARY_PATH=<path_to_libs> mvn test

to execute tests on non-default path (/dev/shm), setup desired directory, e.g.:

LD_LIBRARY_PATH=<path_to_libs> mvn test -Dtest.db.dir=/my/test/dir


We use /dev/shm with emulated persistent memory in examples.

Examples can be found within this repository in examples directory. To execute them, run e.g.:

cd examples
mvn package
PMEM_IS_PMEM_FORCE=1 java -ea -Xms1G -jar StringExample/target/StringExample-*-jar-with-dependencies.jar

If you want to use our examples with pmemkv from maven repository, you can take a look at our testing script executed in our dedicated CI workflow. It boils down to changing build command (mvn package) to e.g.:

mvn package -Dpmemkv.packageName=pmemkv-root -Dpmemkv.packageVersion=1.1.0


Any contributions are welcome. Process, hints and good practices are described in


Debugging process is described in


Docs can be generated using mvn by executing commands:

mvn javadoc:javadoc

Contact us

For more information about pmemkv and java bindings, contact Igor Chorążewicz (, Piotr Balcer ( or post on our #pmem Slack channel using this invite link or Google group.