Tests run fine from Maven but fail with the following error when run from Intellij.
java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no lmdbjni in java.library.path, /tmp/liblmdbjni-64-2515206700199835722.so: liblmdb.so: cannot open shared object file: No such file or directory]
Workaround:
1) run a maven build with a platform profile in order to build liblmdbjni.so and extract liblmdb.so.
2) add lmdbjni-test maven module to the default profile (no profile) root pom.
For some reason LD_LIBRARY_PATH, java.library.path or java.library.tmpdir is not picked up intellij from maven-surefire-plugin without lmdbjni-test in the root pom.
Obviously, it is also possible to extract liblmdb.so to the default LD_LIBRARY_PATH (like /usr/lib) but this makes it harder to manage liblmdb.so as a maven dependency and may even break the target system.
Tests run fine from Maven but fail with the following error when run from Intellij.
java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no lmdbjni in java.library.path, /tmp/liblmdbjni-64-2515206700199835722.so: liblmdb.so: cannot open shared object file: No such file or directory]
Workaround: 1) run a maven build with a platform profile in order to build liblmdbjni.so and extract liblmdb.so. 2) add lmdbjni-test maven module to the default profile (no profile) root pom.
For some reason LD_LIBRARY_PATH, java.library.path or java.library.tmpdir is not picked up intellij from maven-surefire-plugin without lmdbjni-test in the root pom.
Obviously, it is also possible to extract liblmdb.so to the default LD_LIBRARY_PATH (like /usr/lib) but this makes it harder to manage liblmdb.so as a maven dependency and may even break the target system.