Results 1 to 4 of 4
- 07-03-2009, 02:18 AM #1
Member
- Join Date
- Jul 2009
- Posts
- 3
- Rep Power
- 0
Loading a .dylib for Matlab Compiler STUCK!
Well, I got a brand new toy, the MATLAB Builder JA, but it refuses to work for me when I try and use it in Java.
I'm using eclipse.
I will skip the MATLAB part unless anyone thinks it is important.
com.mathworks.toolbox.javabuilder.* comes from javabuilder.jar which is part of the Matlab Libraries needed for this to work and javaBuilderTest.* comes from javaBuilderTest.jar, which is the class that I created using the compiler. They are set as external jars in eclipse.
Here is the code I started out with:
/////////////////////////////////////////////////////////////////////////////
import com.mathworks.toolbox.javabuilder.*;
import javaBuilderTest.*;
public class DisplayTest
{
public static void main(String[] args) throws MWException
{
System.out.println("Preparing to not work in 3...2...1...");
JavaBuilderTest MyObject = new JavaBuilderTest();
}
}
/////////////////////////////////////////////////////////////////////////////
And I received the following delicious output:
/////////////////////////////////////////////////////////////////////////////
Preparing to not work in 3...2...1...
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to find the library libmwmclmcrrt.7.10.dylib, required by MATLAB Builder JA, on java.library.path
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration$ProxyLibraryDir.get(MCRConfiguration.jav a:123)
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration$ProxyLibraryDir.<clinit>(MCRConfiguratio n.java:126)
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration.getProxyLibraryDir(MCRConfiguration.java :131)
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration$MCRRoot.get(MCRConfiguration.java:62)
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration$MCRRoot.<clinit>(MCRConfiguration.java:7 2)
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration.getMCRRoot(MCRConfiguration.java:77)
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration$ModuleDir.<clinit>(MCRConfiguration.java :51)
at com.mathworks.toolbox.javabuilder.internal.MCRConf iguration.getModuleDir(MCRConfiguration.java:56)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.< clinit>(MWMCR.java:1447)
at javaBuilderTest.JavaBuilderTestMCRFactory.<clinit> (JavaBuilderTestMCRFactory.java:98)
at javaBuilderTest.JavaBuilderTest.<init>(JavaBuilder Test.java:61)
at DisplayTest.main(DisplayTest.java:14)
/////////////////////////////////////////////////////////////////////////////
so in my infinite wisdom I tried this code:
/////////////////////////////////////////////////////////////////////////////
import com.mathworks.toolbox.javabuilder.*;
import javaBuilderTest.*;
public class DisplayTest
{
public static void main(String[] args) throws MWException
{
String path = new String("/Applications/MATLAB/MATLAB_Compiler_Runtime/v710/runtime/maci/libmwmclmcrrt.7.10.dylib ");
System.out.println(path);
System.out.println(System.getProperty("java.librar y.path"));
System.load(path);
System.out.println("Preparing to not work in 3...2...1...");
JavaBuilderTest MyObject = new JavaBuilderTest();
}
}
/////////////////////////////////////////////////////////////////////////////
And got this output:
/////////////////////////////////////////////////////////////////////////////
/Applications/MATLAB/MATLAB_Compiler_Runtime/v710/runtime/maci/libmwmclmcrrt.7.10.dylib
.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /Applications/MATLAB/MATLAB_Compiler_Runtime/v710/runtime/maci/libmwmclmcrrt.7.10.dylib
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1705)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1005)
at DisplayTest.main(DisplayTest.java:12)
/////////////////////////////////////////////////////////////////////////////
So I'm not sure what I need to do. That is clearly the path of the library. I copied it and pasted it, and it shows up in terminal. UnsatisfiedLinkError is the error thrown when it the file doesn't exist, correct?
Please help me out. This is getting pretty annoying. Am I loading the file correctly?
Thanks
--John
-
Have you set Eclipse to recognize the JAR files by placing them in the "Build Path"?
- 07-03-2009, 05:25 AM #3
Member
- Join Date
- Jul 2009
- Posts
- 3
- Rep Power
- 0
yes, I set them as external jars under buid path > libraries. Do I have to do something similar for libmwmclmcrrt.7.10.dylib?
- 07-03-2009, 05:36 AM #4
Member
- Join Date
- Jul 2009
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
run a matlab script from java
By npoorni in forum Advanced JavaReplies: 5Last Post: 02-11-2010, 03:32 PM -
compiler,JIT compiler & interpreter
By gamilah in forum New To JavaReplies: 4Last Post: 11-04-2008, 12:32 AM -
Help, Integrate a Java with Matlab
By toby in forum Advanced JavaReplies: 2Last Post: 08-07-2008, 07:08 AM -
java.io.IOException: CreateProcess: matlab error=2
By Jack in forum Advanced JavaReplies: 3Last Post: 04-10-2008, 09:01 AM -
I need to be able to deal with functions like matlab
By romina in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:37 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks