Java bindings for pmemkv
The current API is simplified and not functionally equal to its native C/C++ counterpart. In the future existing API may be extended in idiomatic way without preserving backward compatibility. All known issues and limitations are logged as GitHub issues.
- Java 8 or higher
- PMDK - native persistent memory libraries
- pmemkv - native key/value library
- pmemkv-jni - JNI integration library
- Used only for development & testing:
Start by installing pmemkv on your system.
Next install pmemkv-jni.
It may be necessary to configure a proxy and set
JAVA_TOOL_OPTIONS environment variables:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
Clone the pmemkv-java tree:
git clone https://github.com/pmem/pmemkv-java.git cd pmemkv-java
Finish by installing these bindings:
LD_LIBRARY_PATH=path_to_your_libs mvn install
This library includes a set of automated tests that exercise all functionality.
LD_LIBRARY_PATH=path_to_your_libs mvn test
We are using
emulate persistent memory
Example can be found within this repository in examples directory. To execute the example:
javac -cp ../target/*.jar BasicExample.java PMEM_IS_PMEM_FORCE=1 java -ea -Xms1G -cp .:`find ../target -name *.jar` -Djava.library.path=/usr/local/lib BasicExample