I have a Java class which I am going to be calling from MATLAB. The only place where I call the Java class from is in a sub-function in my MATLAB file. Right now I am never calling that sub-function because the Java class has some errors in it. However, when I execute the main function in the MATLAB file, it appears that some of the Java code in that class is being executed.
Specifically it appears that "clinit" (the function which initializes a class when a Java class is loaded) is being called to execute the static blocks and initialize static data. This only seems to happen the first time the file is called.
For example I have the following code in my MATLAB file:
function mainfundisp 'mainfun'function subfundisp 'subfun'x=work.StaticError();
and when I call mainfun I receive the following message ERROR: Warning: A Java exception occurred trying to load the work.StaticError class: Java exception occurred: java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: nolib at java.lang.Runtime.load0(Unknown Source) at java.lang.System.load(Unknown Source) at work.StaticError.<clinit>(StaticError.java:8)
Best Answer