What's In The Java SDK 2.0
Have you been itching for JDK 1.1 support in Visual J++? You might have been disappointed to find out that when you upgraded to Visual J++ Version 1.1, it didn't include JDK 1.1 support. Well, the cure for your blues is almost over! Microsoft has recently released the Microsoft Java SDK 2.0 Preview. The Microsoft Java SDK 2.0 includes support for most JDK 1.1 classes, improved ActiveX integration, support for JavaBeans™, the Application Foundation Class (AFC) libraries, JDBC support, Direct-
X support, a new version of the Java compiler and a Java Virtual Machine. Let's take a closer look at some of these important improvements.
How Complete Is JDK 1.1 Support?
The Microsoft Java SDK 2.0 includes support for much of the JDK 1.1 classes; however, there are some holes in its support. I suppose there are at least a couple of reasons for these gaps:
Undoubtedly, this rivalry plays a part in the JDK 1.1 support holes. Nonetheless, as developers we still have to create applications and figure out how and when to make use of the latest development tools. With that in mind, let's look at JDK 1.1 features supported by the Microsoft Java SDK 2.0:
- The Microsoft Java SDK 2.0 was completed while the JDK 1.1 was still in development.
- The rivalry between Microsoft, JavaSoft and Sun is certainly no secret.
While the Microsoft Java SDK 2.0 does support much of the JDK 1.1 enhancements, its support is not complete. The missing features include:
- Inner class support
- Instance initializers
- Class literals
- Support for the @deprecated tag
- Anonymous classes and array expressions
- Support for uncompressed JAR files
- Raw native interface support
- Support for reflection
- Object serialization
- Complete Unicode character support
- Abstract Windowing Toolkit enhancements
It's important to note that even though the Microsoft Java SDK 2.0 supports most of the JDK 1.1, it doesn't include support for the JDK 1.02. Microsoft has promised to include complete JDK 1.1 and 1.02 support in future releases of their Java SDK. Unfortunately, they haven't given us a timetable for future releases.
- Lack of support for java.net.* networking enhancements
- Lack of support for printing
The Microsoft Java SDK 2.0 does include some support for JavaBeans. As you may recall, the JavaBeans architecture allows you to create components in Java that interoperate with the CORBA and COM object component models. When using JavaBean support, any ActiveX component can be viewed as a Bean and any Bean can be viewed as an ActiveX component. You need to be running the Java Virtual Machine included with Microsoft Java SDK 2.0 to support JavaBean components. The Microsoft Java SDK 2.0 currently does not include complete support for the JavaBeans architecture. Support for Bean persistence, windowless support, and code download features are not included.
The Microsoft Java SDK 2.0 can be used as a standalone Java development tool, just like the JDK from Sun. The tools provided include:
- JVC: The new Java compiler
- AppletViewer: A tool to view standalone Java applets with international support
- JView: A tool to execute your standalone Java applications from a DOS-based window
- WJView: A tool to run Java frame-based applications in a standalone Windows-based window
- JEXGEN: Converts standalone Java applications into Windows-based executable binary applications
- ClassVue: Ability to view a class at the bytecode level
- Jcom: A tool to convert COM components to Java classes
- JavaReg: A tool to register a Java class that utilizes a COM interface
The Microsoft Java SDK 2.0 also includes a number of other classes and improvements. The Application Foundation Classes (AFC) contain: classes which can be used to create user interface controls, classes for graphics and special effects and a set of Enterprise Library classes which support distributed server side resources. It is possible to mix the user interface AFC and AWT classes to speed the development of your Java application user interfaces. Next month, I will begin a closer look at the AFC.
The Microsoft Java SDK 2.0 also includes support for DirectX components running under Windows 95 and Windows NT. Direct-
X components use native interfaces to enhance multimedia, graphic and interactive content in your Java applications. DirectX support includes:
While DirectX support is not complete - and certainly isn't cross platform - if you're building multimedia-enhanced applications targeted for the Windows platform DirectX components can certainly speed the development process. I'll take a closer look at using DirectX from Visual J++ in future columns.
- DirectAnimation: Support for multimedia content in your applications
- Direct3D: Support for 3 dimensional graphics
- DirectSound: Support for sound playback and mixing
- DirectPlay: Support for multi-user game playing over the Internet
- DirectDraw: Support for 2 dimensional graphics
- DirectInput: Support for input devices such as joysticks and other specialized controllers
Using The Java SDK 2.0 From
The Microsoft Java SDK 2.0 is available as a download from the Microsoft Java Web site at http://www.microsoft.com/java. The SDK and associated help files are available as separate downloads. The SDK download file is SDK-JAVA.EXE and the documentation download is SDK-DOCS.EXE. I recommend that you get both of these files. To use the Microsoft Java SDK 2.0 from Visual J++ follow these steps:
- Run the SDK-JAVA application to install the new classes and tools. Before the installation is completed you will be asked if you would like to install Java Support for Internet Explorer. If you choose to install this support, the new Java Virtual Machine will be installed. An automatic method for removing the Java Virtual Machine is not provided.
- To install the new class files, you'll need to run the ClassD application located in the BIN directory of SDK; if you choose to install the SDK in the default directory you'll find it in the \SDK-Java.20\BIN directory. This installs the CLASSES.ZIP file in your JAVA\CLASSES directory (which can be found in the \WINDOWS directory for Windows 95 and \WINNT for Windows NT).
- To unpack the CLASSES.ZIP directory for use with Visual J++, you'll need to execute the command, JAVASRC CLASSES.ZIP, from the JAVA\CLASSES directory. This will make the new classes available to Visual J++ since it's already configured to look in this directory for standard classes.
- Finally, to use the new Java Compiler (Version 1.02.3920), you'll need to start the Visual J++ version 1.1 development environment. Access the Tools|Options menu items to display the Options dialog box as shown in Figure 1. Click on the Directories tab. Select the Java Virtual Machine option from the Platform combo box. Select the Executable files option from the Show directories for combo box. You will need to add the path to the Microsoft Java SDK 2.0 tools in the Directories list box. Click on the last entry in the Directories list box and enter the path to the BIN directory of the Microsoft Java SDK 2.0, \SDK-Java.20\BIN if you installed the SDK in the default directory. Use the arrow icons at the top of the Directories list box to make this entry the first in the list. This will ensure that the newest version of the compiler is found first.
- Make sure that you're using the latest version of the compiler by building a sample application. When you run the compiler you should verify that you're using Version 1.02.390 in the Build output window, as shown in Figure 2.
Impressions: Ready For Prime Time?
While the Microsoft Java SDK 2.0 still bears the markings of a preview release, it is certainly a step in the right direction. The new Java Virtual Machine runs like a preview release and doesn't include any performance optimizations. The final release should run much faster. Some holes still do exist in the support for JDK 1.1: there isn't any support for JDK 1.0.2 and JavaBean support is not provided for all AFC class components. The AFC still is a bit quirky and won't run correctly on all Virtual Machines.
To be fair, the Microsoft Java SDK 2.0 is a preview release and you shouldn't expect all of the bells, whistles and completeness of a final release. If you need complete support for JDK 1.1 in your Java applications today, then the Microsoft Java SDK 2.0 won't get you there. If you want a sneak peak at the next step in Java development from a Microsoft perspective, then the Microsoft Java SDK 2.0 is where you want to be. While it's not ready for prime time production development, the Microsoft Java SDK 2.0 is a good barometer for the future of Java development using Visual J++.
The Microsoft Java SDK 2.0 Preview Release is currently available only on the Microsoft Java Web site at http://www.microsoft.com/java. The Microsoft Visual J++ Web site is at http://www.microsoft.com/visualj. Tune in to these Web sites for the latest Visual J++ and Java SDK 2.0 information.
Next Month: Application Foundation Classes: Re-inventing the Java Application User Interface.
About the Author
John W. Fronckowiak is the author of "Teach Yourself Database Programming With Visual J++ In 21 Days", Sams.net Publishing. Is there a special aspect of Visual J++ you would like to see discussed? Send your ideas and comments to John at [email protected]