I am using Swig to create a Java wrapper for a library written in C ++. Wrappers are created in a package, and then jar 'ed. Files compiled correctly and work fine with java, but I can not name it from MATLAB.
I tried adding the path to the bank in the static Java path file in MATLAB, and then calling the classes in the jar file, but I get the error "Undefined variable or class.." Or, if I try to use javaObject(...) "No class * can be located on Java class path" .
I'm not sure what I'm doing wrong.
EDIT:
To test the C ++ library call from MATLAB, I created a simple data reading class that contains a function that writes a randomly generated vector< vector<double> > to a text file and a function that reads it.
Generated swig files: SimpleReader.java , DoubleVector.java , exampleJNI.java , example.java , DoubleVector2.java in the package com.example.reader . They are compiled and packaged in example.jar (the created DLL is also packaged in a jar).
Everything works fine, calling it from java, so the problem should be specific to MATLAB. There is little code for MATLAB since nothing works. I get to
javaclasspath('c:/reader/reader.jar'); obj = com.example.reader.SimpleReader;
into which I get 'Undefined variable "com" or class "com.example.reader.SimpleReader"'
source share