1

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.
A. R.
  • 93
  • 7
  • 1
    I am not familiar with Matlab. Could you maybe improve your question and explain your problem in a more generic way? – Rainer Nov 07 '16 at 09:00
  • Matlab is just generating my problem by starting a JVM for it's own, so I can't start a JVM in my own .dll because it's running in the Matlab process. – A. R. Nov 07 '16 at 09:24

1 Answers1

1

First. Thanks for updating your question - makes now more sence to me.

I would rather attach to the running JVM. Maybe this could help you.

Attach to running JVM

Regards, Rainer

Community
  • 1
  • 1
Rainer
  • 761
  • 5
  • 20