deephacks / lmdbjni

LMDB for Java
Apache License 2.0
204 stars 28 forks source link

Cannot run lmdbjni-tests from Intellij without workarounds #13

Closed krisskross closed 9 years ago

krisskross commented 9 years ago

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.

krisskross commented 9 years ago

Solved by 0bb497b4a62ca53bf29372ec9f9ef5100e9f823e