|
Just thought I would be a little more clear. I tried my own little code.
I have an M-file:
__________________________________________________________
function JavaBuilderTest
disp('the function worked and you are a big strong man')
end
__________________________________________________________
which is placed in a .jar file javaBuilderTest.jar by the deployment tool.
I have added the javaBuilderTest.jar and javabuilder.jar files to the build path as libraries.
I have written this short class called DisplayTest.java:
__________________________________________________________
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 get the output at the bottom when it runs. Maybe my java and Matlab aren't in
agreement on some paths or something? I really have no clue.
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
javac 1.5.0_16
when I type
getenv JAVA_HOME
ans =
''
even though I typed
set JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
in the command line.
maybe this is the problem? Is this the right path to the JDK on my mac? I didn't install it since it comes preinstalled, so I don't really know. And why won't it set the value.
I'm sorry to ramble on, I just want to show you what I have tried. I hate to be stuck fiddling with this when I would much rather be playing with my new toy that lets me use MATLAB in Java.
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.MCRConfiguration$ProxyLibraryDir.get(MCRConfiguration.java:123)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.<clinit>(MCRConfiguration.java:126)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getProxyLibraryDir(MCRConfiguration.java:131)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.get(MCRConfiguration.java:62)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.<clinit>(MCRConfiguration.java:72)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getMCRRoot(MCRConfiguration.java:77)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ModuleDir.<clinit>(MCRConfiguration.java:51)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.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>(JavaBuilderTest.java:61)
at DisplayTest.main(DisplayTest.java:9)
|