Can't use artifact as it as:
When we build circe-crc32c-sse42 using maven build:
It internally generates "jni" library based on OS where we build and it packages this generated jni library under .nar artifact. e.g: circe-crc32c-sse42.nar
Nar Plugin goal also generates NarSystem.java which tries to load this jni library at runtime using System.loadLibrary("circe-crc32c-sse42-0.1-SNAPSHOT"); which fails obviously because it asks ClassLoader to load library from java.library.path or sun.boot.library.path. And as this jni library is packaged under .nar so, definitely it is not present in either library.path and hence, initialization of the interface which provides API to compute checksum Sse42Crc32C.java fails.
Solution
So, I created a pull request : which generates circe-crc32c-sse42.jar instead circe-crc32c-sse42.nar artifact and internally loads generated jni library without messing up with library.path and user can use this artifact without performing any additional magic.
I have also added a test case which cleanly uses Sse42Crc32C.java to compute checksum by simply adding dependency of artifact com.scurrilous:circe-crc32c-sse42:${project.version} and without worrying about configuring library.path.
Can't use artifact as it as: When we build circe-crc32c-sse42 using maven build:
jni
library under.nar
artifact. e.g:circe-crc32c-sse42.nar
NarSystem.java
which tries to load thisjni
library at runtime usingSystem.loadLibrary("circe-crc32c-sse42-0.1-SNAPSHOT");
which fails obviously because it asksClassLoader
to load library fromjava.library.path
orsun.boot.library.path
. And as thisjni
library is packaged under.nar
so, definitely it is not present in eitherlibrary.path
and hence, initialization of the interface which provides API to compute checksum Sse42Crc32C.java fails.Solution
circe-crc32c-sse42.jar
insteadcirce-crc32c-sse42.nar
artifact and internally loads generatedjni
library without messing up withlibrary.path
and user can use this artifact without performing any additional magic. I have also added a test case which cleanly usesSse42Crc32C.java
to compute checksum by simply adding dependency of artifactcom.scurrilous:circe-crc32c-sse42:${project.version}
and without worrying about configuringlibrary.path
.