Jexegen Samples

These samples are located in \Samples\Native\Jexegen.

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

These samples show how to use the jexegen tool, which binds the class files for a Java application into a Microsoft® Win32® executable.

The following table shows the jexegen samples.

Hello Simple Hello World application; demonstrates the proper command-line parameters to use with jexegen when the application uses packages.
Mapplet The mandelbrot sample application.
Stub Modified version of the Hello sample that uses jexegen's /bindto option and a stub binary to create an executable that runs Hello.java.

Using the Samples

To compile the samples

Hello Use Nmake.exe to compile the makefile in the \Samples\Native\Jexegen\Hello base directory.
Mapplet Use Nmake.exe to compile the makefile in the \Samples\Native\Jexegen\Mapplet base directory.
Stub
  • Use Nmake.exe to compile the makefile in the \Samples\Native\Jexegen\stub base directory:

    nmake cfg=debug

  • Use the following command to build release versions:

    nmake cfg=release


To run the samples

Hello Run the generated executable, Hello.exe.
Mapplet Run the generated executable, Mapplet.exe.
Stub The compiled stub.exe application will reside in the \Samples\Native\Jexegen\Stub\Release or \Samples\Native\Jexegen\Stub\Debug directory, depending on the build option used with nmake. Run stub.exe from the \Samples\Native\Jexegen\stub\Release or from the \Samples\Native\Jexegen\Stub\Debug directory.

Key Project Files

Hello

Makefile

This file creates the executable using the jexegen tool, packaging the Hello Java application.

Hello.java

This simple Java application prints some information to standard output.

Mapplet

Makefile

This file creates the executable using the jexegen tool, packaging the .class files for the Java application.

Stub

stub.cpp

This simple C application uses the JavaExecute COM object installed by the Microsoft virtual machine (Microsoft VM) to create a new virtual machine instance that will run a class file (Hello) bound to stub.exe by jexegen.

stub.h

This file contains header information for the stub application.

stub.mak

This makefile builds the stub application.

stub.rc

This file contains resources for the application.

Technologies Demonstrated

Packaging

This sample shows how to:

Native Code

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