a licensees. As the lawsuits wend their way through the U.S. legal system, some programmers worry that Java and its promise of "Write Once, Run Anywhere" is splintering even more into vendor-specific versions.
Sun charges that with the release of Microsoft's Internet Explorer 4.0 and version 2.0 of the Software Development Kit for Java (SDKJ), Microsoft modified key class libraries of Java. The result, Sun says, could be that developers would unwittingly write programs they think are cross-platform but actually work properly only with Microsoft's latest Java-enabled programs (e.g., IE4). Sun also accuses Microsoft of not supporting standard core Java features such as the Java Native Interface (JNI), an API that lets the Java run-time interpreter invoke native code. Instead, Microsoft ships its own Raw Native Interface, which the company claims offers better performance. Microsoft says doing so is within its rights of the agreement, as is adding methods or fields to Java classes
.
Microsoft's latest SDKJ does have new classes, methods, variables, and other components that are not part of the JDK1.1 reference platform. Sun officials say the more troublesome of the additions are the new public methods added into key Java libraries, such as getWin32Index added to java.awt.SystemColor, or the five new methods added to java.util.Locale. "Developers can unwittingly use these additions, not realizing that their code will then be nonportable," says Carla Schroer, engineering manager responsible for Java compatibility at Sun's JavaSoft division.
Microsoft officials react to such charges with dismay. "Sun's lawsuit is pure PR," says Joe Herman, product manager of Internet Platforms at Microsoft. "Numerous articles and reviews have said Internet Explorer [4.0] is the most compatible, fastest-performing browser available."
Microsoft might be justified in feeling unfairly singled out. Netscape Communications has also added public methods to key Java class libraries and has also
failed to offer JNI support (though Netscape officials say that JNI support is coming). Microsoft officials object to the original lawsuit's charge that the company has failed to support remote method invocation (RMI), although Microsoft had posted RMI to its Web site. "These all boil down to non-issues," says Herman. "Netscape added methods, and Netscape doesn't implement JNI either. So what is the issue here? It's one-sided. Sun is looking for a scapegoat." Sun officials disagree. "There are 117 Java technology licensees today," says Sun's Schroer. "If everyone went and added whatever they wanted into Java packages, it would be total chaos."
Who is right? That's for the courts to declare, but both vendors appear to have valid claims. You can write an applet that is Microsoft-specific using the new SDKJ (
see the example
), but Microsoft is hardly unique in that regard: At press time, Netscape had information on its Web site about how to write programs using some of its modified Ja
va APIs. (Netscape recently removed the Java logo from Communicator 4.04.)
The suits could have a positive effect: increased publicity for Java, the importance of cross-platform compatibility, and the "Write Once, Run Anywhere" concept. In the meantime, programmers who want to write portable code should take care to avoid vendor-specific code.
illustration_link (101 Kbytes)
