link-grammar icon indicating copy to clipboard operation
link-grammar copied to clipboard

Orcale JDK8 library loading config bug

Open mosyp opened this issue 8 years ago • 1 comments

I'm using link-grammar-5.3.15.

This one didn't work for me: https://github.com/opencog/link-grammar/blob/master/bindings/java/org/linkgrammar/LinkGrammar.java#L43 Even when I added /usr/local/lib to jvm props:

java.lang.UnsatisfiedLinkError: no liblink-grammar in java.library.path

I fixed it by replacing that line into:

System.load("/usr/local/lib/liblink-grammar-java.so");

Also, please not that in https://github.com/opencog/link-grammar/blob/master/bindings/java/org/linkgrammar/LinkGrammar.java#L43 jni is marked as link-grammar-java. However I checked my /usr/local/lib and found only liblink-grammar-java.so and other file with prefix liblink-...

UPD. I'm using ubuntu 16.04 and oracle jdk 8.

mosyp avatar Feb 23 '17 16:02 mosyp

Java usually handles the suffixes automatically -- .so for unix variants, or .dll for windows variants, or .dylib for MacOS variants ... including any of these suffixes explicitly would break compatibility with the different OS'es.

Is it possible that your version of oracle jdk is not correctly configured for Ubuntu? Perhaps there is some way to tell Java what suffixes should be searched for? Perhaps that search algorithm is missing or broken in jdk8? This code has been working fine on java 5 and java 6, dating back ten years now; the breakage is not the code, but some install/config issue.

linas avatar Mar 14 '17 06:03 linas