This sample is located in \Samples\Native\Invocation.
Note It is recommended that you have Microsoft® Visual C++® version 5.0 or higher installed.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
This sample shows how to use the PrepareThreadForJava and UnprepareThreadForJava invocation APIs.
To compile the sample
Use Nmake.exe to compile the makefile in the \Samples\Native\Invocation directory. Type the following command:
Nmake
The makefile builds the C application and compiles the Java class.
To run the sample
Use the Invokevm.exe application to run the sample. When you run the sample, the Java class, TestClass, writes text to the standard output.
This file is a simple C application that uses the Microsoft virtual machine's Raw Native Interface (RNI) functionality to invoke an arbitrary method in the sample Java object, TestClass.
TestClass.javaThis small Java class contains a single method that prints to standard output for demonstration purposes.