--- old/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.cpp 2017-07-07 10:40:26.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.cpp 2017-07-07 10:40:25.000000000 -0700 @@ -140,56 +140,6 @@ return result; } -TString LinuxPlatform::GetSystemJRE() { - if (GetAppCDSState() != cdsDisabled) { - //TODO throw exception - return _T(""); - } - - TString result; - TString jreHome = GetEnv("JRE_HOME"); - - if (jreHome.empty() == false) { - result = FilePath::IncludeTrailingSeparater(jreHome); - - if (FilePath::FileExists(result + _T("lib/rt.jar")) == false) { - result = FilePath::IncludeTrailingSeparater(jreHome) + _T("jre"); - - if (FilePath::FileExists(result + _T("/lib/rt.jar")) == false) { - //check redhat location - if (FilePath::FileExists(_T("/usr/java/latest/jre/lib/rt.jar")) == true) { - result = _T("/usr/java/latest/jre"); - } - else if (FilePath::FileExists(_T("/usr/lib/jvm/default-java/jre/lib/rt.jar")) == true) { - result = _T("/usr/lib/jvm/default-java/jre"); - } - else { - result = _T(""); - } - } - } - } - - return result; -} - -TString LinuxPlatform::GetSystemJVMLibraryFileName() { - TString result; - TString jreHome = GetSystemJRE(); - - if (jreHome.empty() == false && FilePath::DirectoryExists(jreHome) == true) { - result = FilePath::IncludeTrailingSeparater(jreHome) + - _T("/lib/"JAVAARCH"/client/libjvm.so"); - - if (FilePath::FileExists(result) == false) { - result = FilePath::IncludeTrailingSeparater(jreHome) + - _T("/lib/"JAVAARCH"/server/libjvm.so"); - } - } - - return result; -} - bool LinuxPlatform::IsMainThread() { bool result = (FMainThread == pthread_self()); return result; --- old/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.h 2017-07-07 10:40:28.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.h 2017-07-07 10:40:28.000000000 -0700 @@ -69,8 +69,6 @@ virtual TString GetModuleFileName(); virtual TString GetBundledJVMLibraryFileName(TString RuntimePath); - virtual TString GetSystemJVMLibraryFileName(); - virtual TString GetSystemJRE(); virtual ISectionalPropertyContainer* GetConfigFile(TString FileName); --- old/modules/jdk.packager/src/main/native/library/common/MacPlatform.h 2017-07-07 10:40:31.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/MacPlatform.h 2017-07-07 10:40:30.000000000 -0700 @@ -62,8 +62,6 @@ virtual TString GetPackageRootDirectory(); virtual TString GetAppDataDirectory(); virtual TString GetBundledJVMLibraryFileName(TString RuntimePath); - virtual TString GetSystemJVMLibraryFileName(); - virtual TString GetSystemJRE(); virtual TString GetAppName(); virtual ISectionalPropertyContainer* GetConfigFile(TString FileName); --- old/modules/jdk.packager/src/main/native/library/common/MacPlatform.mm 2017-07-07 10:40:33.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/MacPlatform.mm 2017-07-07 10:40:32.000000000 -0700 @@ -181,26 +181,6 @@ return result; } - -TString MacPlatform::GetSystemJRE() { - if (GetAppCDSState() != cdsDisabled) { - //TODO throw exception - return _T(""); - } - - return _T("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib"); -} - -TString MacPlatform::GetSystemJVMLibraryFileName() { - TString result = GetSystemJRE(); - - if (FilePath::FileExists(result) == false) { - result = _T(""); - } - - return result; -} - TString MacPlatform::GetAppName() { NSString *appName = [[NSProcessInfo processInfo] processName]; TString result = [appName UTF8String]; --- old/modules/jdk.packager/src/main/native/library/common/Package.cpp 2017-07-07 10:40:35.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/Package.cpp 2017-07-07 10:40:35.000000000 -0700 @@ -124,11 +124,6 @@ FBootFields->FIsRuntimeBundled = true; config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[JVM_RUNTIME_KEY], FBootFields->FJVMRuntimeDirectory); - if (FBootFields->FJVMRuntimeDirectory.empty()) { - FBootFields->FIsRuntimeBundled = false; - FBootFields->FJVMRuntimeDirectory = platform.GetSystemJRE(); - } - // Read jvmargs. PromoteAppCDSState(config); ReadJVMArgs(config); @@ -610,9 +605,6 @@ TString jvmRuntimePath = macros.ExpandMacros(GetJVMRuntimeDirectory()); FBootFields->FJVMLibraryFileName = platform.GetBundledJVMLibraryFileName(jvmRuntimePath); } - else { - FBootFields->FJVMLibraryFileName = platform.GetSystemJVMLibraryFileName(); - } } return FBootFields->FJVMLibraryFileName; --- old/modules/jdk.packager/src/main/native/library/common/Package.h 2017-07-07 10:40:38.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/Package.h 2017-07-07 10:40:37.000000000 -0700 @@ -62,7 +62,6 @@ TString FMainJar; TString FMainModule; TString FMainClassName; - bool FIsRuntimeBundled; TString FJVMRuntimeDirectory; TString FJVMLibraryFileName; TString FSplashScreenFileName; --- old/modules/jdk.packager/src/main/native/library/common/Platform.h 2017-07-07 10:40:40.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/Platform.h 2017-07-07 10:40:40.000000000 -0700 @@ -425,8 +425,6 @@ virtual TString GetConfigFileName() = 0; virtual TString GetBundledJVMLibraryFileName(TString RuntimePath) = 0; - virtual TString GetSystemJVMLibraryFileName() = 0; - virtual TString GetSystemJRE() = 0; // Caller must free result. virtual ISectionalPropertyContainer* GetConfigFile(TString FileName) = 0; --- old/modules/jdk.packager/src/main/native/library/common/WindowsPlatform.cpp 2017-07-07 10:40:42.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/WindowsPlatform.cpp 2017-07-07 10:40:42.000000000 -0700 @@ -171,62 +171,6 @@ return result; } -#define BUFFER_SIZE 256 - -// try to find current Java Home from registry -// -// HKLM\Software\JavaSoft\Java Runtime Environment\CurrentVersion -// HKLM\Software\JavaSoft\Java Runtime Environment\[CurrentVersion]\JavaHome -// -// note that this has been changed in JDK9 to -// -// HKLM\Software\JavaSoft\JRE\CurrentVersion -// HKLM\Software\JavaSoft\JRE\[CurrentVersion]\JavaHome -// -// return non-empty string as path if found -// return empty string otherwise - -TString GetSystemJREForSubkey(TString javaRuntimeSubkey) { - Registry registry(HKEY_LOCAL_MACHINE); - TString result; - - if (registry.Open(javaRuntimeSubkey)) { - TString version = registry.ReadString(_T("CurrentVersion")); - - if (!version.empty()) { - if (registry.Open(javaRuntimeSubkey + TString(_T("\\")) + TString(version))) { - TString javaHome = registry.ReadString(_T("JavaHome")); - - if (FilePath::DirectoryExists(javaHome)) { - result = javaHome; - } - } - } - } - - return result; -} - -TString WindowsPlatform::GetSystemJRE() { - if (GetAppCDSState() != cdsDisabled) { - //TODO throw exception - return _T(""); - } - - TString result; - result = GetSystemJREForSubkey(_T("SOFTWARE\\JavaSoft\\JRE")); - if (!result.empty()) { - return result; - } - - result = GetSystemJREForSubkey(_T("SOFTWARE\\JavaSoft\\Java Runtime Environment")); - if (!result.empty()) { - return result; - } - - return result; -} - void WindowsPlatform::ShowMessage(TString title, TString description) { MessageBox(NULL, description.data(), !title.empty() ? title.data() : description.data(), MB_ICONERROR | MB_OK); } @@ -265,17 +209,6 @@ return result; } -TString WindowsPlatform::GetSystemJVMLibraryFileName() { - TString result; - TString jvmPath = GetSystemJRE(); - - if (jvmPath.empty() == false) { - result = GetBundledJVMLibraryFileName(jvmPath); - } - - return result; -} - ISectionalPropertyContainer* WindowsPlatform::GetConfigFile(TString FileName) { IniFile *result = new IniFile(); --- old/modules/jdk.packager/src/main/native/library/common/WindowsPlatform.h 2017-07-07 10:40:44.000000000 -0700 +++ new/modules/jdk.packager/src/main/native/library/common/WindowsPlatform.h 2017-07-07 10:40:44.000000000 -0700 @@ -66,8 +66,6 @@ virtual TString GetPackageRootDirectory(); virtual TString GetAppDataDirectory(); virtual TString GetBundledJVMLibraryFileName(TString RuntimePath); - virtual TString GetSystemJVMLibraryFileName(); - virtual TString GetSystemJRE(); virtual ISectionalPropertyContainer* GetConfigFile(TString FileName);