java.lang.UnsatisfiedLinkError,我无法解决它

时间:2011-01-11 20:11:47

标签: java hyperlink native opencl

我正在尝试设置一个使用Java和OpenCL的程序。我正在使用JOCL的绑定。这是我从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)
    ...
    ...

这是我的.bashrc设置:

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

export LD_PRELOAD=/usr/java/jdk1.6.0_23/jre/lib/amd64/libjsig.so

有什么想法吗?我被卡住了......

1 个答案:

答案 0 :(得分:3)

LD_LIBRARY_PATH和java.library.path不相同,尽管它们相似。在命令行中将-Djava.library.path设置为库所在的位置。

或者甚至 - System.get.println(System.getProperty(“java.library.path”))就在加载库之前 - 看看它认为路径是什么......