This article was previously published under Q183712
This article provides details on how to install the SDK for Java and how touse the Clspack, Classd.exe, and Javasrc.exe utilities.
The Microsoft Java Virtual Machine (MSJVM) is not available for distribution from Microsoft. It is not being included in future Microsoft products. Microsoft software and SKUs that currently include the MSJVM will continue to be discontinued or be replaced by versions that do not contain the MSJVM. Between 1999 and 2003, Microsoft issued 10 MSJVM security updates. A cumulative update is available on the Microsoft Windows Update Web site. For more information, visit the following Microsoft Web site:
Following is a checklist of items that provides direction on how to installthe SDK for Java and to use its utilities.
The SDK for Java requires Microsoft[ASCII 174] Windows 95, Windows 98, or Windows NT4.0, and the latest retail version of Internet Explorer. If you haveInternet Explorer 3.02, then make sure you have Authenticode 2.0 and thatthe Security Settings are enabled to allow downloading of active content.To do this, from the browser's View menu, click Options, and then select"Allow downloading of Active Content" in the Security tab).
There are two ways to install the SDK for Java. You can choose either ofthe following methods:
SDKSetupWizard. This is the ActiveSetup that provides step-by-step instructions to install all the SDK components including the Virtual Machine for Java. NOTE: The ActiveSetup requires a network connection, so if you attempt to use this setup to install SDK for Java on a machine that does not have a network or modem connection, it will not install.
Self-Extracting Executable. You can download the SDK for Java using the SDK-JAVA.EXE file. For example, if you are experiencing network problems or if you want to install on a machine after terminating your network connection, you can run the previously downloaded SDK-JAVA.EXE. Note that the Microsoft VM will not be installed via this distributable and will need to be installed separately. Additional SDK components may also be required per your installation needs. For more information about this download, visit the following Microsoft Web site::
Clspack is a tool that is used to create a new Classes.zip file in the\%Windir%\Java\Classes directory. This tool converts packages that arecurrently installed via the package manager and writes their contents intoa ZIP file. You can find this tool in <sdk-dir>\Bin directory and in the\%Windir%\ directory.
The typical command to run Clspack is as follows:
This will create a Classes.zip file and place all the Java packages in%Windir%\Java\Classes\Classes.zip. It contains all system classes stored inthe JPM. The Microsoft compiler for Java (jvc) checks this location bydefault, so there is no need to set your classpath environment variable.If you use another Java compiler that does not check this location, setyour class path variable as follows:
NOTE: If you have used SDKSetupWizard for installing SDK for Java, thenthis tool is automatically run as soon as you reboot your machine afterinstallation. If, on the other hand, you have used the self-extracting filefor installation, then make sure you run Clspack-auto manually afterinstalling all the components.
What Are Classd.exe and Classr.exe and Javasrc.exe?
Microsoft Visual J++ users can also experience the benefits of theSDK for Java with these updated versions of system classes that containclass debug information as well as Java source for most system classes.These classes should be used with the corresponding VM release. TheJavasrc.exe tool, provided with Visual J++ and the SDK, should be used toremove extract the source files onto the local machine.
Classd.exe is a utility that installs debug versions of system classes and many Java source files for the system classes to the package manager and onto the CLASSPATH. You can find this file in <sdk-dir>\Bin directory. You can also download it separately. For more information, visit the following Microsoft Web site:
After running Classd.exe, make sure to reboot your machine.
Javasrc.exe is a utility that extracts source code out of the debugging version of the system classes (Classes.zip that got created via Classd.exe) on to the local drive. You can find this file in <sdk-dir>\Bin directory. The typical command to run JavaSrc is as follows:
This will now enable you to debug Java applications and step into the code of some of the Java system classes. NOTE: If you run Classd.exe from the <sdk-dir>\Bin directory and then run Javasrc.exe from the same folder, the error message, "Unable to open file Classes.zip" may appear. Run JavaSrc from within the %Windir%\Java\Classes directory (you can copy the Javasrc.exe from the <sdk-dir>\Bin directory to %Windir%\Java\Classes directory), or run it with a command line that includes the path to Classes.zip:
Classr.exe is a utility that installs retail version of the system classes to the package manager and onto the CLASSPATH.
How to Use the JDK 1.1 Features with Visual J++?
In order to be able to use the JDK1.1 language features with Visual J++,you need to use the Jvc.exe that comes with the SDK for Java version 2.0xor newer.This Jvc.exe also includes the ability to compile code with the followingfeatures:
Uncompressed JAR File Support
Support @COM syntax for JActiveX users
Support @DLL syntax for JDirect
In order to use the new JVC from Visual J++:
Back up your current Visual J++'s copy of Jvc.exe, Jps.dll, and Msjvc.dll. You can locate these files in the DevStudio\SharedIDE\bin directory.
Then copy the following files from your <sdk-dir>\Bin directory to the DevStudio\SharedIDE\Bin directory:
How to Use the Other Tools Provided with the SDK For Java
In order to be able to use the other tools in the SDK, make sure you pointto the <sdk-dir>\Bin directory. Most of the SDK tools are under thisdirectory. Note, however, that the CABAndSIGN tools are located in the<sdk-dir>\Bin\PackSign directory.
NOTE 1: Jactivex.exe is a new tool that replaces JAVATLB that ships withVisual J++ 1.x. This tool can be found in the <sdk-dir>\Bin directoryand is extensively used for creating wrapper classes for ActiveX objects inJava.
Here is the command to run this tool:
"Filename" is the file name of the type library (*.tlb, *.olb, *.ocx, *.dllor *.exe). This generates java source code (.java) rather than the .classfiles that JAVATLB generates. The generated Java source requires newfunctionality not present in older versions of the compiler in MicrosoftVisual J++ 1.x. So you need to compile the generated .java files with theJvc.exe that ships with the SDK for Java versions 2.0x or newer.
NOTE 2: Also note that the SDK for Java versions 2.0x or newer provides anew version of JavaReg.exe (version 2.0; the original version is JavaReg1.0 that ships with Visual J++ 1.x). This tool is used for registering Javaclasses as COM objects. JavaReg.exe can also be found under the <sdk-dir>\Bin directory.
To download the latest retail version of Internet Explorer, see thefollowing Web site:
Microsoft Software Development Kit for Java 3.1, Microsoft Software Development Kit for Java 2.02, Microsoft Software Development Kit for Java 2.01, Microsoft Software Development Kit for Java 2.02, Microsoft Software Development Kit for Java 3.0, Microsoft Visual J++ 1.0 Standard Edition, Microsoft Visual J++ 1.1 Standard Edition