It sounds like what you need is a way to call C++ code from inside a Java program.
Refer to this tutorial http://www.ibm.com/developerworks/java/tutorials/j-jni/j-jni.html
It explains how the Java Native Interface, part of the Java Software Development Kit, can be used to call C++ code from Java and Java code from C++ programs.
solved Could I use C++ code with JAVA code? [closed]