--- old/modules/jdk.packager/src/main/native/library/common/JavaVirtualMachine.h 2016-09-13 10:24:01.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/JavaVirtualMachine.h 2016-09-13 10:24:00.000000000 -0700 @@ -48,7 +48,7 @@ #endif //MAC #ifdef LINUX -//#define USE_JLI_LAUNCH +#define USE_JLI_LAUNCH #endif //LINUX --- old/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.cpp 2016-09-13 10:24:02.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.cpp 2016-09-13 10:24:02.000000000 -0700 @@ -35,6 +35,7 @@ #ifdef LINUX +#include "JavaVirtualMachine.h" #include "LinuxPlatform.h" #include "PlatformString.h" @@ -126,6 +127,15 @@ } TString LinuxPlatform::GetBundledJVMLibraryFileName(TString RuntimePath) { +#ifdef USE_JLI_LAUNCH + TString result = FilePath::IncludeTrailingSeparater(RuntimePath) + + "lib/"JAVAARCH"/jli/libjli.so"; + + if (FilePath::FileExists(result) == false) { + result = FilePath::IncludeTrailingSeparater(RuntimePath) + + "lib/"JAVAARCH"/jli/libjli.so"; + } +#else TString result = FilePath::IncludeTrailingSeparater(RuntimePath) + "jre/lib/"JAVAARCH"/client/libjvm.so"; @@ -143,6 +153,7 @@ result = FilePath::IncludeTrailingSeparater(RuntimePath) + "lib/"JAVAARCH"/server/libjvm.so"; } +#endif return result; } --- old/modules/jdk.packager/src/main/native/library/common/Messages.cpp 2016-09-13 10:24:04.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/Messages.cpp 2016-09-13 10:24:04.000000000 -0700 @@ -37,13 +37,18 @@ #include "FilePath.h" #include "Helpers.h" #include "Macros.h" +#include "JavaVirtualMachine.h" Messages::Messages(void) { FMessages.SetReadOnly(false); FMessages.SetValue(LIBRARY_NOT_FOUND, _T("Failed to find library.")); FMessages.SetValue(FAILED_CREATING_JVM, _T("Failed to create JVM")); +#ifndef USE_JLI_LAUNCH FMessages.SetValue(FAILED_LOCATING_JVM_ENTRY_POINT, _T("Failed to locate JNI_CreateJavaVM")); +#else + FMessages.SetValue(FAILED_LOCATING_JVM_ENTRY_POINT, _T("Failed to locate JLI_Launch")); +#endif FMessages.SetValue(NO_MAIN_CLASS_SPECIFIED, _T("No main class specified")); FMessages.SetValue(METHOD_NOT_FOUND, _T("No method %s in class %s.")); FMessages.SetValue(CLASS_NOT_FOUND, _T("Class %s not found."));