I have an executable JAR which runs in the command line. I would like to create a GUI for this program using VC++ for windows. Is there any way to ‘hook into’ the Java thread from the native C++, or launch the JAR from within the C++ thread? I have looked at the JNI, but it appears that the Java needs to be written to take this functionality into account. At the moment, I do not have the capability to modify the pre-compiled JAR. Is what I’m trying to do even possible?
Thanks in advance for any advice you can give.
The java only needs to be written with JNI functionality if you want to call C++ from Java. If you want to call Java from C++ it will work fine without any changes to the JAR. If you look at the source code to java.exe you can see an example of this.
Look at around lines 540-610 in the java.exe source code