我一直在尝试在Java中运行hello world示例,使用Matlab Builder JA编译 在带有雪豹的英特尔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
我看过一些类似的帖子但是没有解决方案似乎有效
答案 0 :(得分:1)
我已将DYLD_LIBRARY_PATH设置如下,并且有效。
DYLD_LIBRARY_PATH =:/ Applications / MATLAB / MATLAB_Compiler_Runtime / v715 / runtime / maci64: /应用/ MATLAB / MATLAB_Compiler_Runtime / V715 /斌/ maci64: /应用/ MATLAB / MATLAB_Compiler_Runtime / V715 / SYS / OS / maci64
答案 1 :(得分:0)
您列出的DYLD_LIBRARY_PATH变量
DYLD_LIBRARY_PATH = /Applications/MATLAB_R2011a.app/runtime/maci64:/ Applications / MATLAB / MATLAB_Compiler_Runtime / v715 / bin
中有空格(在maci64
之后和:/Applications
之前)。如果这不是你问题中的拼写错误,那么我认为这可能就是问题所在。