Transvirtual Adopts Microsoft Java Extensions

October 1st, 1999 by Craig Knudsen in

Mr. Knudsen tells us why this company chose to add MS extensions to Kaffe, the open-source Java implementation.
Your rating: None

Kaffe, first released in 1996, was the original open-source Java implementation. Initially developed as part of another project, it grew so popular that developers Tim Wilkinson and Peter Mehlitz founded Transvirtual Technologies, Inc. with Kaffe as the company's flagship product. In July of 1998, Transvirtual released Kaffe OpenVM under a GNU license.

Kaffe's multi-platform support and small footprint have attracted many users. On-line magazine JavaWorld gave Kaffe their Editors' Choice Award for Best Virtual Machine for 1998, stating, “Java has been waiting for Kaffe for a long time. A proper open-source, cross-platform JVM, free of restrictive licenses, is a must for the complete acceptance of Java.” Kaffe was originally released as source code long before the term “open source” had been coined. It was the first Java Virtual Machine (JVM) for many operating systems and was also one of the first to offer a Just-In-Time (JIT) compiler for many architectures, improving Java's runtime performance.

Microsoft's Java extensions have created a good deal of controversy. Sun claims that Microsoft violated the terms of its Java licensing agreement and has filed a highly publicized lawsuit. Microsoft's version of Java was not “write once, run anywhere” as Sun intended Java to be. To much of the Java community, it appeared as though Microsoft was attempting to splinter Java with extensions like J/Direct and new Java keywords (“delegate” and “multicast”) that gave Java developers new capabilities not otherwise available in Java. Applications using these extensions are required to use Microsoft's JVM.

At first look, it may seem surprising that a company known for its open source, clean-room implementation of Java would add support for Microsoft extensions to the language. However, by adding support for these extensions to Kaffe, Transvirtual is allowing Java programs developed under Windows (using Microsoft Visual J++) that make use of the extensions to run on non-Windows platforms such as Linux, FreeBSD and Solaris. Additionally, Transvirtual is providing a new source for Java on the Windows platforms.

The first extension Kaffe supports is delegates. The delegate keyword essentially provides a function pointer. This allows an application developer to tie an event to a specific user interface element (such as a push button). Microsoft added the new “delegate” keyword to the Java language to support this. (At the time delegates were introduced, Java was at level 1.0.2 and had not yet introduced the new 1.1 event model which provides similar capabilities.) Microsoft Visual J++ is required in order to compile the Java code if you make use of the delegate keyword. Up until now, you also had to use Microsoft's JVM to run the compiled Java application. Kaffe's support for this extension allows non-Windows users to run Java code that makes use of the delegate extension. For now, you will still need to compile your application with Visual J++. But, you can deploy the compiled Java code on Linux or any other Kaffe-supported platform.

Delegates is only the first extension that Kaffe will support. Microsoft's J/Direct provides similar functionality to Sun's JNI, giving developers access to application-specific functions. Why would anyone choose J/Direct over JNI? According to Transvirtual founder and CEO Tim Wilkinson, “I wouldn't primarily expect UNIX users to pick these extensions up and run with them, but since Windows users are using them, I don't want them marooned on Windows-NT for the rest of their natural lives. J/Direct support, in particular, makes it far simpler to move Java code which uses an application-specific native library to UNIX.” Wilkinson went on to say that J/Direct “provides similar functionality to JNI in, as far as I'm concerned, a much cleaner fashion.”

Although funding was supplied by Microsoft to add these extensions to Kaffe, the relationship was initiated by Transvirtual. Transvirtual wanted to give users the freedom to choose a non-Microsoft platform even if they developed their code with Microsoft tools. Microsoft made documentation available on their web site (see Resources), but did not contribute any code or other intellectual property. One of the conditions of Transvirtual's support for the extensions was that the result would be released as open source under the GNU GPL.

Why would Microsoft be interested in open-source implementations of their Java extensions? Sun's lawsuit against Microsoft has placed the future of Microsoft's Java implementation in jeopardy. The extensions added to Kaffe are at the heart of the lawsuit. Many companies are beginning to look for a second source for Java. A version of Kaffe for Windows with AWT 1.1 and native threads support was scheduled to be released in late July.

By supporting delegates (and eventually J/Direct and Java/COM), Transvirtual has made it possible to take code developed using J++ and deliver it to Linux. One of the great strengths of Linux is its interoperability with other operating systems. By providing this technology to the Linux community, Transvirtual has added to this strength.

Resources

Kaffe OpenVM's Supported Platforms

Craig Knudsen (cknudsen@radix.net) lives in Fairfax, VA and telecommutes full-time as a web engineer for ePresence, Inc. of Red Bank, NJ. Craig has been using Linux for both work and play for three years. When he's not working, he and his wife Kim relax with their two Yorkies, Buster and Baloo.

__________________________


Special Magazine Offer -- 2 Free Trial Issues!
Receive 2 free trial issues of Linux Journal as well as instant online access to current and past issues. There's NO RISK and NO OBLIGATION to buy. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Sorry, offer available in the US only. International orders, click here.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

linux

On October 2nd, 2007 enigma variations mp3 (not verified) says:

error: caught locations signal compilation stops my compiler "Internal cc1 random 11."? program fatal Why kernel with: at does . Bye.

Featured Videos

Email is one of the least private and least secure forms of communication, although few people realize this. MixMaster is one way to allow secure, anonymous communication even over the very public medium of email. This tutorial will get you started with MixMaster quickly and easily.

In case you were wondering about the fun side of Linux World Expo, we thought we'd give you a peek at our shenanigans. We at Linux Journal love what we do so much, that we can't help but have a ball wherever we go.

From the Magazine

September 2008, #173

Feeling a bit like a Thermian? Never give up, never surrender! Someday, you could go from underdog to top dog. Just take a look at a few of the underdogs we highlight in this issue: Mutt, djbdns, Nginix, Gentoo, Xara and the program voted mostly likely to fail just a few years back—Firefox. If Firefox is not radical enough for you, check out Chef Marcel's column for some more alternatives. Having trouble mapping your program data to your relational database? If so, Rueven Lerner shows you some tricks in his At The Forge column.

Need to run GUI applications on your server in the next state? In his Paranoid Penguin column, Mick Bauer shows you how to do it securely. Kyle Rankin keeps hacking and slashing and shows you a few split screen secrets you may not be familiar with. Finally, we all know what happens next February, but only Doc knows what happens afterward.

Read this issue