Java and Win32 Programming - Kishore J Doshi

With the latest version of the Microsoft virtual machine, it is now possible to integrate Java applications and Win32 by:

  • Using COM/DCOM Services through a Java Wrapper for the Interfaces

  • Using ActiveX Controls as Java Beans
  • Making Windows API System Calls, using Win32 common controls or User-Defined Native Methods in Java Applications

  • Using the tools that come with the Microsoft SDK for Java(which includes the latest version of the virtual machine), we can create Java applications that allow us to take advantage of the Win32 integration from the Microsoft Virtual Machine.


    Tools included with the SDK for Java include:

  • Jvc: The Microsoft Java compiler. This is the same version of the compiler that ships with Visual J++ 6.0. Microsoft has integrated COM and Win32 with Java and uses extensions to compiler that a user is defining the Java equivalent of a COM interface or Win32 method. It is interesting to note that these extensions are central to the Sun lawsuit against Microsoft.. Sun argues that the Microsoft extensions are not part of the Sun Java Language Specification, thus shouldn’t be part of Java! When you run the Microsoft Compiler with extensions on, you get the following message:
  • "Note: Use of the Microsoft language extensions for Java results in compiled
    code that will run only on Windows systems with the Microsoft Virtual Machine
    for Java installed and may not run on other virtual machines. The Microsoft
    Virtual Machine for Java is installed with Windows 98 and a freely
    redistributable version is included with this product. While future versions
    of Microsoft Java's development tools may be prohibited by court order from
    from incorporating keyword extensions and compiler directives not contained
    in Sun's Java language specification, any code written and compiled with this
    version of the product will be unaffected by such a ruling."

  • Jview: The Microsoft Virtual Machine. This is what Internet Explorer uses for it’s VM. Any Java applications written using the Microsoft extensions needs to be run on this VM
  • JactiveX: Reads the .tbl file for an Automation object like a COM service or ActiveX control. This program reads the tbl file and creates Java wrapper classes so that the interfaces these objects provide services for can be used in Java applications.

  • What's included in this section:

  • Using COM in Java Applications

  • A simple HelloWorld COM server with a Java App as the Client

  • The DS420 DCOM project replacing the ActiveX control with a Java App

  • Refrences and Links