Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/sample/vm/clr-jvm/README.txt
38829 views
This sample provides Java "Hello World" program that is invoked1from C# application in the same process.23The problem of direct call of the JVM API from CLR applications4by PInvoke interface is the JVM API functions do not have static5adresses, they need to be got by JNI_CreateJavaVM() call.6The sample contains C++ libraty that wraps JVM API calls by the7static functions that are called from the C# application by8PInvoke interface.910The sample contains the following files:1112Makefile - make file13README.txt - this readme14invoked.java - the invoked HelloWorld Java program15invoker.cs - C# invoker application16jinvoker.cpp - C++ wrapper17jinvokerExp.h - wrapper library exports1819After the success making the following files are produced:2021invoked.class - the compiled HelloWorld class22invoker.exe - the executable .NET program that invokes Java23jinvoker.dll - the wrapper library2425The following environment needs to be set for the correct sample26build and execution:2728INCLUDE must contain the paths to:291. MS Visual C++ standard include302. .NET SDK include313. Java includes32Example: %MSDEV%/VC98/Include;%DOTNET%/Include;%JAVA_HOME%/include;%JAVA_HOME%/include/win323334LIB must contain the paths to:351. MS Visual C++ standard libraries362. .NET SDK libraries373. jvm.dll38Example: %MSDEV%/VC98/Lib;%DOTNET%/Lib;%JAVA_HOME%/jre/bin/client3940PATH must contain the paths to:411. MS Visual C++ standard bin422. MS Dev common bin433. .NET SDK libraries444. Java bin455. jvm.dll46Example: %MSDEV%/VC98/Bin;%MSDEV%/Common/MSDev98/Bin;%DOTNET%/Lib;%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin/client;%PATH%4748To run the sample please do:4950invoker.exe invoked515253--Dmitry Ryashchentsev545556