I am trying to setup a program that uses Java and OpenCL. I am using JOCL's bindings for this. Here is the error I get when I build from Ant:
Error while loading native library "JOCL-linux-x86_64" with base name "JOCL"
Operating system name: Linux
Architecture : amd64
Architecture bit size: 64
Stack trace:
java.lang.UnsatisfiedLinkError: no JOCL-linux-x86_64 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
...
...
Here is my .bashrc setup:
export PATH=.:/bin:/usr/bin:/usr/local/bin://home/djkashta/Desktop/bp-trunk/app/BlueprintCore/scripts:/usr/java/jdk1.6.0_23/bin
export LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib64:/usr/lib:/usr/local/lib:/usr/local/cuda/computeprof/bin:/home/djkashta/Desktop/bp-trunk/bundles/CopperShark/native/linux/2.6.28/x86_64/:/usr/java:/usr/java/jdk1.6.0_23/bin/java:/usr/java/jdk1.6.0_23:/usr/java/jdk1.6.0_23/bin:/usr/lib/jvm
export LD_PRELOAD=/usr/java/jdk1.6.0_23/jre/lib/amd64/libjsig.so
export JDK_HOME=/usr/java/jdk1.6.0_23
export JAVA_HOME=/usr/java/jdk1.6.0_23
export ANT_HOME=/opt/apache-ant-1.7.1
I don't understand why I have this problem. I don't get this on my Ubuntu machine which is setup just like this RedHat machine. The libJOCL-linux-x86_64.so
is present in one of the LD_LIBRARY_PATH
. If I do which Java, I get: /usr/java/jdk1.6.0_23/bin/java
Any ideas? I am stuck...
LD_LIBRARY_PATH and java.library.path are not the same, although they are similar. On the command line set -Djava.library.path to the place that your library is in.
or, even - System.out.println(System.getProperty("java.library.path")) just before loading the library - to see what it thinks the path is...