blob: a8fe79db343b3ab902827229ff704377cd274539 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001This sample provides C# "Hello World" program that is invoked
2from Java application in the same process.
3
4There is no way to invoke .NET methods from Java classes directly,
5it is necessary to use native code level.
6The sample contains C++ library that can invoke any .NET program by mscorlib library.
7Using the JNI the Java application invokes the C# "Hello World".
8
9The sample contains the following files:
10
11Makefile - make file
12README.txt - this readme
13invoked.cs - the invoked HelloWorld Java program
14invoker.java - C# invoker application
15invoker.cpp - C++ wrapper
16invokerExp.h - wrapper library exports
17invoker.h - javah generated file with the native method definition
18
19After the success making the following files are produced:
20
21invoked.exe - the executable HelloWorld .NET program
22invoker.class - the compiled Java class that invokes the .NET program
23invoker.dll - the wrapper library
24
25The following environment needs to be set for the correct sample
26build and execution:
27
28INCLUDE must contain the paths to:
29 1. MS Visual C++ standard include
30 2. .NET SDK include
31 3. Java includes
32 Example: %MSDEV%/VC98/Include;%DOTNET%/Include;%JAVA_HOME%/include;%JAVA_HOME%/include/win32
33
34LIB must contain the paths to:
35 1. MS Visual C++ standard libraries
36 2. .NET SDK libraries
37 Example: %MSDEV%/VC98/Lib;%DOTNET%/Lib
38
39PATH must contain the paths to:
40 1. MS Visual C++ standard bin
41 2. MS Dev common bin
42 3. .NET SDK libraries
43 4. Java bin
44 Example: %MSDEV%/VC98/Bin;%MSDEV%/Common/MSDev98/Bin;%DOTNET%/Lib;%JAVA_HOME%/bin;%PATH%
45
46To run the sample please do:
47
48java invoker invoked.exe
49
50
51--Dmitry Ryashchentsev