Is there an easy way to call C++ code from Java and the other way around?
Created May 4, 2012
JunC++ion has a code generator that generates C++ proxy classes for Java classes. These C++ proxy classes are usable like the underlying Java classes. All communications between components in the two different languages are performed under the hood through JNI.
This allows you to write C++ code like:
#include "java_lang_System.h"
#include "java_lang_String.h"
using namespace java::lang;
int main()
{
String test( "test" );
System::out.println( "This is a " + test );
}
The code generator is capable of generating C++ proxy classes of all compiled Java classes. Therefore you can use it to
JunC++ion is currently generally available on "Wintel" where it works with all major JVMs (Sun, IBM, and Microsoft). Ports to Solaris, AIX, Linux and HP-UX are underway.