diff --git a/bin/WinLauncher/WinLauncher.exe b/bin/WinLauncher/WinLauncher.exe index 585699f6f40b..d93b0c7c8e62 100644 Binary files a/bin/WinLauncher/WinLauncher.exe and b/bin/WinLauncher/WinLauncher.exe differ diff --git a/bin/WinLauncher/WinLauncher64.exe b/bin/WinLauncher/WinLauncher64.exe index 1c5c2af20708..d12485758d15 100644 Binary files a/bin/WinLauncher/WinLauncher64.exe and b/bin/WinLauncher/WinLauncher64.exe differ diff --git a/native/WinLauncher/WinLauncher/WinLauncher.cpp b/native/WinLauncher/WinLauncher/WinLauncher.cpp index 295b3a32b542..aafeef8dcdca 100644 --- a/native/WinLauncher/WinLauncher/WinLauncher.cpp +++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp @@ -1,5 +1,5 @@ /* -* Copyright 2000-2018 JetBrains s.r.o. +* Copyright 2000-2019 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -565,6 +565,9 @@ bool LoadVMOptions() vmOptionLines.push_back(std::string("-Djb.vmOptionsFile=") + EncodeWideACP(used)); if (!AddClassPathOptions(vmOptionLines)) return false; + std::string dllName(jvmPath); + std::string binDir = dllName + "\\bin"; + vmOptionLines.push_back(std::string("-Djava.library.path=") + binDir); AddPredefinedVMOptions(vmOptionLines); vmOptionCount = vmOptionLines.size(); @@ -582,6 +585,7 @@ bool LoadJVMLibrary() { std::string dllName(jvmPath); std::string binDir = dllName + "\\bin"; + TCHAR currentDir[MAX_PATH]; std::string serverDllName = binDir + "\\server\\jvm.dll"; std::string clientDllName = binDir + "\\client\\jvm.dll"; if ((bServerJVM && FileExists(serverDllName)) || !FileExists(clientDllName)) @@ -593,13 +597,15 @@ bool LoadJVMLibrary() dllName = clientDllName; } - // ensure we can find msvcr.dll which is located in jre/bin directory; jvm.dll (awt.dll) depends on it. - SetDllDirectoryA(binDir.c_str()); + // ensure we can find msvcr100.dll which is located in jre/bin directory; jvm.dll depends on it. + GetCurrentDirectory(sizeof(currentDir),currentDir); + SetCurrentDirectoryA(binDir.c_str()); hJVM = LoadLibraryA(dllName.c_str()); if (hJVM) { pCreateJavaVM = (JNI_createJavaVM) GetProcAddress(hJVM, "JNI_CreateJavaVM"); } + SetCurrentDirectory(currentDir); if (!pCreateJavaVM) { std::string jvmError = "Failed to load JVM DLL ";