I'm trying to crate an Matlab IMAQ adapter for a 3D camera using the Java API of this camera.
So I create a .dll for Matlab within I handle the connection to the camera. There are specific functions needed by Matlab within I would like to call the Java functions of the API to connect to the device and make image acquisition.
My problem is Matlab is already starting a JVM, so I can't directly start a JVM in the adaptor, because in this case I would try to run two JVMs in one process
So my question is, which one is the better way:
- Creating a new process in the adaptor to start a new JVM which will load the used .jar file in the classpath.
- Attach to the running JVM started by Matlab and load the .jar I need in the running JVM.