我一直在尝试在 Java 中运行 hello world 示例,在带有 Snow Leopard 的英特尔 Mac 上使用 Matlab Builder JA 编译。当我在终端上运行 .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 :/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/bin
XAPPLRESDIR= /Applications/MATLAB_R2011a.app/X11/app-defaults
我看过一些类似的帖子,但似乎没有一个解决方案有效