How to avoid potential pitfalls of Microsoft's non-standard SDK for Java
Find out exactly which methods, classes, and variables have been added to, or omitted from, the key Java class libraries in
Microsoft's implementation of Java 1.1
By John Zukowski, JavaWorld.com, 11/01/97
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Microsoft's Internet Explorer (IE) 4.0 has been out for a little over a week now, and the company now is shipping the 2.0
version of its Software Development Kit (SDK) for Java. According to Microsoft's Win32 Virtual Machine for Java Release Notes
(see the
Resources section below for links to this document and other information related to this article), the virtual machine (VM) for Java
that ships with IE 4.0 is the same as the one in the new SDK. Using the Java class files that come with the SDK and comparing
them to the Java class files that come with Sun's Java Development Kit (JDK) 1.1.4 release reveals exactly why Alan Baratz,
president of Sun's JavaSoft division, said, "Microsoft deceptively altered key classes and inserted them into their SDK."
(This was during the conference detailing Sun's October 7 announcement of Sun's suit against Microsoft alleging breach of
contract. For more information on this lawsuit, see "
Sun-Microsoft dispute gets ugly," in the October 1997 issue of
JavaWorld.)
I have analyzed the classes and have run across seven areas that should be of great concern to developers if they want to develop solutions with Microsoft's SDK for Java that will work
in other Java 1.1 certified environments. These areas of concern are:
- new classes (Hey, what's that class doing there?)
- new methods (And where did these methods and instance variables come from?)
- new variables (And where did these methods and instance variables come from?)
- modified interfaces (What about the interface changes?)
- the com.ms packages (Inside com.ms)
- missing methods (What's missing in the SDK)
- behavioral differences (And what's different)
These go far beyond the often-cited concern over Microsoft's lack of JNI and RMI support, as mentioned in my October 1997
JavaWorld article, "
What does Sun's lawsuit against Microsoft mean for Java developers?"
Baratz used the word "deceptively" in Sun's announcement of the lawsuit because the (javadoc) documentation for the Java classes
that comes with the SDK makes no mention of these changes. To find these differences, it is necessary to use either the ClassVue
tool that comes with the SDK or manually examine the source code. Your best bet is to rely on ClassVue, as the source files
provided with the SDK are not always the ones used for the generated classes. For those unfamiliar with ClassVue, the equivalent
tool that comes with the JDK from Sun is javap, a class file internals examiner.
As much as I'd like to claim that what follows is an exhaustive list of changes to the SDK, it is possible that something
was missed. With several items, there is a pattern -- so if you avoid similarly named things you should be okay. All of the
problems identified here are in the java.lang, java.io, java.awt, java.util, and java.security packages/sub-packages.
So, what changed in each package?
- java.awt: New classes, New methods, New variables
- java.lang: New methods, New variables
- java.io: Dropped methods
- java.security: Modified interfaces
- java.util: New methods, New variables
The first set of changes in Microsoft's SDK for Java is new classes, methods, and variables that were added to the system
packages. A system package, or core Java API, is anything that begins with java.* in its fully qualified class name. So, as
far as new classes go, 16 new ones were added into java.awt. These are:
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- Sun Microsystems, Inc. v. Microsoft Corp. http://home.dti.net/bdpc/java.htm
- "Sun-Microsoft dispute gets ugly," JavaWorld, October 1997 http://www.javaworld.com/jw-10-1997/jw-10-sunsuit.html
- "What does Sun's lawsuit against Microsoft mean for Java developers?", JavaWorld, October 1997 http://www.javaworld.com/jw-10-1997/jw-10-lawsuit.html
- Microsoft's Win32 Virtual Machine for Java Release Notes http://microsoft.com/java/sdk/20/relnotes/vm.htm
- Rule 3 of SunTest's "100% Pure Java Cookbook" http://www.suntest.com/100percent/cpd/doc/cbook/cookbook.html#8592
- Microsoft's Application Foundation Classes http://microsoft.com/java/sdk/20/relnotes/afc.htm
- Internet Explorer 4.0 http://microsoft.com/ie/ie40/
- Microsoft's SDK for Java http://microsoft.com/java/sdk/20/relnotes/intro.htm
- Microsoft does provide RMI (along with other unsupported tools, utilities, and libraries) -- via an FTP server ftp://ftp.microsoft.com/developr/msdn/unsup-ed/rmi.zip
- Borland's JBuilder http://www.borland.com/jbuilder/
- IBM's VisualAge for Java http://www.software.ibm.com/ad/vajava/
- Symantec's Visual Cafe http://www.symantec.com/domain/cafe/deved/index.html
- Should Microsoft be allowed to alter the key class libraries of Java? Take our latest poll http://nigeria.wpi.com/cgi-bin/gwpoll/gwpoll/ballot.html
- A review of platform-neutral Java development tools in NC World, JavaWorld's sister publication http://www.ncworldmag.com/ncw-10-1997/ncw-10-jvtools.html
- Nick Petreley's commentary about the Sun/MS lawsuit, also in NC World http://www.ncworldmag.com/ncw-10-1997/ncw-10-straypackets.html
- Alex Chaffee's analysis of Java implementation differences http://www.stinky.com/java/