Home      Company      Customers      Solutions      Publications      Press      Contact Us    
  orange box Automatic Java Byte Code to Windows COM objects conversion utility

The Objective

System for conversion from JAVA classes to C code and -subsequently- Windows Native COM Objects. 

A customer required that a previously developed Java based simulation be ported to run in Windows.  Java byte code was converted to native Windows COM objects callable from Visual Basic application. As an intermediate step Java byte code was converted to the C equivalent of the Java classes.  

The Approach

ACG's Soft Chip Technology examines Java byte code to produce monolith C code for compact embedded systems. This is the process flow Labeled 1 in the figure. As a variation, Java Byte Code is examined to determine the interfaces needed to be exposed in a Windows environment. The Java byte code is first converted to C then an interface wrapper is automatically added to implement Idispatch, (including the TLB and IDL files generated by examining the Java byte code). 

The resulting C code is then compiled in a Windows development environment. 
The Java Byte code is thus successfully converted to a functionally equivalent native Windows COM object capable of running in process and without a JVM. This is the process flow labeled 2 in the figure.

We also experimented with another approach - to run the Java Byte Code in a JVM with Remote Procedure Calls (RPC) between the Java application and a COM interface in the Windows application. A thin interface layer is produced that makes an out of process call to the Java application. In this case, the Java Byte code is examined to generate the interface wrapper to the RPC call. This is the process flow labeled 3 in the figure above. 

From the perspective of the Windows based development environment, cases 2,3 are functionally identical. However case 2 is more efficient because a) there is no overhead of a JVM and b) In process calls are significantly faster than out of process calls because of the overhead associated with marshalling.

To validate our approach, ACG wrote some Java classes that were then converted to COM objects running within VB. The outputs of the the Java classes to those produced by the VB program were compared. For more information: 

1- Review documents:         www.advancedcybernetics.com/publications/J2COMDEMO.pdf
2- Example Demonstration: www.advancedcybernetics.com/publications/J2COMDEMO.ZIP

The Benefits

Development and deployment environments are joined at the hip by common system services. Automatic conversion of of code written in Java to run natively in Windows enables Java code to run in Windows without the overhead of a JVM and be callable from a IDE for Windows applications e.g. Visual Basic. 

One application of this technology is the ability to take "legacy" Java code and efficiently integrate it into a Windows platform. This enables the enterprise to standardize on one deployment platform and still maintain multiple development platforms. 

Note The conversion is taking place at the byte code level, as opposed to more traditional approaches where conversion takes place at the language level e.g. Java to C#. The latter approach is not always feasible: the source code is not always available, or the domain expert is no longer with the company. Nor is it always practical: Java developers with the domain knowledge of the current code base may not be motivated to learn new a language.

Byte code level automatic code translation engenders cross platform development yet helps manage costs of deployment by enabling a single deployment environment.