gpt4 book ai didi

java.lang.UnsatisfiedLinkError,我无法解决

转载 作者:行者123 更新时间:2023-12-04 06:37:43 29 4
gpt4 key购买 nike

我正在尝试设置一个使用 Java 和 OpenCL 的程序。我为此使用了 JOCL 的绑定(bind)。这是我从 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.soexport JDK_HOME=/usr/java/jdk1.6.0_23export JAVA_HOME=/usr/java/jdk1.6.0_23export ANT_HOME=/opt/apache-ant-1.7.1I 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
有任何想法吗?我被困住了...






最佳答案





LD_LIBRARY_PATH 和 java.library.path 不一样,虽然它们很相似。在命令行上将 -Djava.library.path 设置为您的库所在的位置。

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








关于java.lang.UnsatisfiedLinkError,我无法解决,我们在Stack Overflow上找到一个类似的问题:

https://stackoverflow.com/questions/4662106/




29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com