Java bindings for pmemkv, using Java Native Interface. Currently functionally equal to pmemkv in version 1.0. Some of the new functionalities (from pmemkv 1.1+) are not available yet.
All known issues and limitations are logged as GitHub issues or are described in pmemkv's man pages.
- pmemkv - native key/value library
- Java 8 or higher
- Apache Maven - build system
- Used only for development & testing:
- JUnit - automated test framework
- Oleaster Matcher - test condition matching library
Start by installing pmemkv (currently at least in version 1.0.2) in your system.
It may be necessary to configure a proxy
and set JAVA_HOME
& 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
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 it may be also necessary to set it in LD_LIBRARY_PATH, e.g.:
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 /dev/shm
to
emulate persistent memory
in example.
Example can be found within this repository in examples directory. To execute the example:
cd examples
javac -cp ../src/main/target/*.jar BasicExample.java
PMEM_IS_PMEM_FORCE=1 java -ea -Xms1G -cp .:`find ../src/main/target -name *.jar` -Djava.library.path=/usr/local/lib BasicExample
After installation, docs can be generated using ... by executing commands:
...