EDIT: Se solution at the bottom of the page
I'm trying to set the java.library.path system setting for my Bioclipse manager/Eclipse plugin.
Normally, if running java from command line, this variable should be set like so (According to what I've googled up):
java -Djava.library.path=/usr/local/lib/pl-5.7.15/lib/i686-linux/JavaClassName
so I have tried to add the line
-Djava.library.path="/usr/local/lib/pl-5.7.15/lib/i686-linux/"
return System.getProperty("java.library.path")
I've found some hints about how to do that for normal Eclipse projects. But I haven't succeded getting it to work, so could it has to be done in a special way in Bioclipse?
Any hints are most welcome
When I try to run a simple test (From the attached java examples) accessing the Jpl and running a prolog query, I get first this error:
Caused by: java.lang.UnsatisfiedLinkError: no jpl in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at jpl.JPL.loadNativeLibrary(JPL.java:100) at jpl.fli.Prolog.<clinit>(Prolog.java:85) at jpl.Query.open(Query.java:286) at jpl.Util.textToTerm(Util.java:162) at jpl.Query.<init>(Query.java:198) at net.bioclipse.blipkit.business.BlipkitManager.test(BlipkitManager.java:34) ... 45 more
Next time I run the same function I get this error:
... Caused by: java.lang.NoClassDefFoundError at jpl.Query.open(Query.java:286) at jpl.Util.textToTerm(Util.java:162) at jpl.Query.<init>(Query.java:198) at net.bioclipse.blipkit.business.BlipkitManager.test(BlipkitManager.java:34) ... 45 more
The interesting files in this case seem to be
/usr/local/lib/pl-5.7.15/lib/i686-linux/libjpl.so
/usr/local/lib/pl-5.7.15/lib/jpl.jar
Bundle-NativeCode
header in the Manifest file. <-- Remember this!I needed to edit the [managername].product file in text mode, and added a parameter that set the java.library.path in the launcherArgs > vmArgs tag, like so (See the end of the vmArgs tag):
<launcherArgs> <programArgs>-consolelog -data "@nodefault" -noUpdate</programArgs> <vmArgs>-ea -Xmx512M -XX:MaxPermSize=128m -Djava.library.path=/usr/local/lib/pl-5.7.15/lib/i686-linux</vmArgs> <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac> </launcherArgs>
Java / Prolog communication now seems to work. Will have to see if there are better ways to load / encapsulate the library (libjpl.so, which is located in /usr/local/lib/pl-5.7.15/lib/i686-linux
) though, or whether it is possible to include it as source code.