Errors when I execute matlab compiled code with netbeans but not in the terminal
1 次查看(过去 30 天)
显示 更早的评论
I don't understand why when I execute the code in the terminal, I have the right output but in netbeans I always have errors. (Are Netbeans and Terminal have the access to the same env variables or not?)
Terminal:
$ export DYLD_LIBRARY_PATH=/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/runtime/maci64:/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/sys/os/maci64:/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/bin/maci64:/System/Library/Frameworks/JavaVM.framework/JavaVM:/System/Library/Frameworks/JavaVM.framework/Libraries
$ export XAPPLRESDIR=/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/X11/app-defaults
$ java -cp "/Users/nourdine/NetBeansProjects/testMatlab/build/classes:/Users/nourdine/Documents/MATLAB/makesqr/demo/distrib/demo.jar:/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/toolbox/javabuilder/jar/javabuilder.jar" testmatlab.TestMatlab
output: [0 1]
Netbeans 7:
run:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getProxyLibraryDir(MCRConfiguration.java:178)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.get(MCRConfiguration.java:77)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.<clinit>(MCRConfiguration.java:87)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getMCRRoot(MCRConfiguration.java:92)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ModuleDir.<clinit>(MCRConfiguration.java:66)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getModuleDir(MCRConfiguration.java:71)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1553)
at com.demo.DemoMCRFactory.newInstance(DemoMCRFactory.java:49)
at com.demo.DemoMCRFactory.newInstance(DemoMCRFactory.java:60)
at com.demo.MLTestClass.<init>(MLTestClass.java:63)
at testmatlab.TestMatlab.main(TestMatlab.java:25)
Caused by: java.lang.NullPointerException
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.get(MCRConfiguration.java:143)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.<clinit>(MCRConfiguration.java:173)
... 11 more
Java Result: 1
to set DYLD_LIBRARY_PATH, I edited the file .bash_profile in my user folder with:
export DYLD_LIBRARY_PATH="the same links as above"
More info:
$java -version:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
javaBuilder.jar
Created-By: 1.6.0_20 (Apple Inc.)
OS X 10.10.3
MAtlab R2011a MacOS X 10.10.3
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!