我一直试图在Java中运行用Matlab Builder JA编译的hello world示例
在装有Snow Leopard的Intel Mac上。当我在终端上运行.jar时,出现以下错误:
java.lang.LinkageError: dlopen(/Applications/MATLAB_R2011a.app/bin/maci64/libnativemcl.jnilib, 9):
Library not loaded: libtbb.dylib
Referenced from: /Applications/MATLAB_R2011a.app/bin/maci64/libut.dylib
Reason: image not found
at com.mathworks.toolbox.javabuilder.internal.DynamicLibraryUtils.dlopen(Native Method)
at com.mathworks.toolbox.javabuilder.internal.DynamicLibraryUtils.loadLibraryAndBindNativeMethods(DynamicLibraryUtils.java:131)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1554)
at hellopck.HellopckMCRFactory.newInstance(HellopckMCRFactory.java:49)
at hellopck.HellopckMCRFactory.newInstance(HellopckMCRFactory.java:60)
at hellopck.hellocls.main(hellocls.java:114)
我想这与我的环境变量有关,但是我找不到确切的问题。我的环境变量设置为:
DYLD_LIBRARY_PATH = /Applications/MATLAB_R2011a.app/runtime/maci64
:/应用程序/ MATLAB / MATLAB_Compiler_Runtime / v715 / bin
XAPPLRESDIR = /Applications/MATLAB_R2011a.app/X11/app-defaults
我看过几篇类似的文章,但没有一种解决方案似乎有效
最佳答案
我已经将DYLD_LIBRARY_PATH设置如下,并且可以正常工作。
DYLD_LIBRARY_PATH =:/应用程序/ MATLAB / MATLAB_Compiler_Runtime / v715 / runtime / maci64:
/ Applications / MATLAB / MATLAB_Compiler_Runtime / v715 / bin / maci64:
/ Applications / MATLAB / MATLAB_Compiler_Runtime / v715 / sys / os / maci64
关于java - Matlab Builder JA libtbb.dylib错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6170512/