blob: a081c878c94bcdbc1fd1a54be31b7e9dc4cd4910 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001This sample provides Java "Hello World" program that is invoked
2from C# application in the same process.
3
4The problem of direct call of the JVM API from CLR applications
5by PInvoke interface is the JVM API functions do not have static
6adresses, they need to be got by JNI_CreateJavaVM() call.
7The sample contains C++ libraty that wraps JVM API calls by the
8static functions that are called from the C# application by
9PInvoke interface.
10
11The sample contains the following files:
12
13Makefile - make file
14README.txt - this readme
15invoked.java - the invoked HelloWorld Java program
16invoker.cs - C# invoker application
17jinvoker.cpp - C++ wrapper
18jinvokerExp.h - wrapper library exports
19
20After the success making the following files are produced:
21
22invoked.class - the compiled HelloWorld class
23invoker.exe - the executable .NET program that invokes Java
24jinvoker.dll - the wrapper library
25
26The following environment needs to be set for the correct sample
27build and execution:
28
29INCLUDE must contain the paths to:
30 1. MS Visual C++ standard include
31 2. .NET SDK include
32 3. Java includes
33 Example: %MSDEV%/VC98/Include;%DOTNET%/Include;%JAVA_HOME%/include;%JAVA_HOME%/include/win32
34
35LIB must contain the paths to:
36 1. MS Visual C++ standard libraries
37 2. .NET SDK libraries
38 3. jvm.dll
39 Example: %MSDEV%/VC98/Lib;%DOTNET%/Lib;%JAVA_HOME%/jre/bin/client
40
41PATH must contain the paths to:
42 1. MS Visual C++ standard bin
43 2. MS Dev common bin
44 3. .NET SDK libraries
45 4. Java bin
46 5. jvm.dll
47 Example: %MSDEV%/VC98/Bin;%MSDEV%/Common/MSDev98/Bin;%DOTNET%/Lib;%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin/client;%PATH%
48
49To run the sample please do:
50
51 invoker.exe invoked
52
53
54--Dmitry Ryashchentsev