Samples Overview

The Microsoft SDK for Java includes over 90 samples to be used as a reference for Java application development. When you download the SDK for Java, these samples and their documentation are installed in the %SDKDIR%\Samples folder and its subfolders.

To display the documentation for a sample, select the sample's name in the left frame. The samples are organized by category according to the technologies they demonstrate. Samples that illustrate several technologies are listed in more than one category.

Samples that are applets are built and ready to run. The documentation for each sample applet contains a button that launches the applet in a separate browser window.

Samples that are not applets must be built. Makefiles are provided for this purpose. The %SDKDIR%\Bin directory of the Microsoft SDK for Java includes the Nmake.exe tool that compiles these makefiles. You can build all samples by typing nmake on the main level makefile located in the %SDKDIR%\Samples directory.

Note   For users of Microsoft® Visual J++®, the Samples contained within the Microsoft SDK for Java support newer features supported by the Microsoft Compiler for Java (Jvc.exe).

To use these new language features with Microsoft® Visual J++® and the Microsoft SDK for Java Samples, you must replace three files in Visual J++ with their respective SDK versions:

  1. Back up the current Visual J++ versions of Jvc.exe, Jps.dll, and Msjvc.dll.

  2. Copy Jvc.exe, Jps.dll, and Msjvc.dll from %SDKDIR%\Bin to your Visual J++ directory. Projects and samples will then build using the new compiler.

The following samples will require Microsoft® Visual C++® version 5.0 or later:

COM

CCIEX; CustomMarshal; IMarshal; IPersist; JCOMApartment; Native_com; NTService; Security_com; COMClassObject; iid_is_size_is

Debugger

C++ Debugger; CALLTRACE

Native

BrowserAppletControl; Invocation; Jview; Native_raw; Jexegen_Stub

Profiler

Heapmon; Jviewprf; sampmon

Security

RNI

Make sure that you have updated the Microsoft virtual machine with the version that shipped with this release. You must also set your build environment for the languages that you will be using. For example, run the VCVARS32.BAT file that Visual C++ created on your computer if you will be compiling the samples that include C code. Individual samples may have additional requirements, which are noted in the samples descriptions.

Note   For users of Microsoft® Visual J++®, the Samples contained within the Microsoft SDK for Java support newer features supported by the Microsoft Compiler for Java (Jvc.exe).

To use these new language features with Microsoft® Visual J++® and the Microsoft SDK for Java Samples, you must replace three files in Visual J++ with their respective SDK versions:

  1. Back up the current Visual J++ versions of Jvc.exe, Jps.dll, and Msjvc.dll.

  2. Copy Jvc.exe, Jps.dll, and Msjvc.dll from %SDKDIR%\Bin to your Visual J++ directory. Projects and samples will then build using the new compiler.

Note   If you do not run vcvars32.bat from Visual C++, the main level makefile will only build the samples that do not require Visual C++. If you run vcvars32.bat (from Microsoft® Visual C++® 5 or 6), it will build both the samples that do require Visual C++ and the samples that do not require Visual C++.

Note the following issues with the AFC samples:

© 1999 Microsoft Corporation. All rights reserved. Terms of use.