C++ code communication with Java
<p>I have a Java based desktop application. Now also along there is a camera sdk, through which one can control the camera (i.e. get the latest picture from camera, generate thumbnail's, camera clock etc). This code to handle all this is written in C++.</p>

<p>What is the best provision to interact both the above parts. What I want is:</p>

<ol>
<li>2-way communication.</li>
<li>C++ code should communicate with the Java process about any error in process or Image received successfully etc. This can be pure text or an Integer.</li>
<li>If possible, the C++ code should be able to give the Image object. Or at worse, it can give the temporary file path to the Image which Java can load it.</li>
</ol>

<p>My options:</p>

<ol>
<li>Have the C++ code run as a separate process and let both of them communicate through some sort of message passing. For ex through db/file. Suggestions needed here.</li>
<li>Have a Java wrapper. i.e. by using jni or jna. I have never worked on this so do not have much idea about the feasibility</li>
</ol>

<p>Anyother efficient and better way?</p>
