I'm working on a project and I wish to call java programs in Matlab. A sample structure of java programs are given as follows:
mainproj
/ | \
src lib bin
/ \ / \
a b ac bd
Folder "lib" contains jar files. Folders ac and bd have .classes of java. Folders a and b have java files + some other class files. I wish to run a java file named "launcher.java" under folder a, it uses jar files and calls a java program available in folder b, which has launcher.class file in folder ac.
I'm confused how to call this program successfully. I found some solutions online but they are not working for me. Calling Java from MATLAB?, Calling Java from MATLAB, Is it worth to call java from matlab?, Calling Java from Matlab is very slow.
The launcher.java file is as follows:
package ac;
import....
public class launcher
{
....
....
public static void main(String[] args) { run();}
public static void run() {......}
}
What I performed is as follows:
javaaddpath('mainproj\lib\x.jar')
javaaddpath('mainproj\bin\ac')
import mainproj.*;
import mainproj.lib.*;
import mainproj.bin.*;
import mainproj.bin.ac.*;
import mainproj.bin.bd.*;
l = launcher;
javaMethod('main', l);
[I wish to call main of launcher.class in folder as that automatically calls run() method, and run() calls other class file in folder bd]
The output error I'm getting is : No class launcher can be located or no methods for class
Any suggestion/help is appreciated.