Developer tool for integrating C++ objects with Java applets and applications

Platform(s):  AIX, Windows 95, Windows NT, OS/2
Date Posted:  28 March 1997
Updated: 

J2C++ is a code generation tool that allows a Java applet or application to access C++ objects seamlessly by making them appear as if they were implemented in Java. J2C++ parses a C++ definition file (e.g. an .hpp file) and generates a mapping layer consisting of Java source and C++ source which exploits the native method call interface of the Java Virtual Machine (JVM). A makefile builder (mkmake) simplifies the tasks required to build the generated source code. Both a Java compiler (javac) and C++ compiler are needed to build the mapping layer.

When the Java proxy class is used in a Java program, a one-to-one relationship is established between the proxy object and its corresponding C++ object. When the proxy object is instantiated, its corresponding C++ object is also instantiated. In addition, when the JVM garbage collector frees a Java proxy object, the associated C++ object is removed as well. J2C++ also supports C++ code that does not belong to a particular C++ class definition (i.e. overloaded nonmember operators, global functions and global variables).

J2C++ does have limitations due to the differences between C++ and Java. For example, J2C++ only supports single inheritance and does not support templates or member selection operators.