mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-207158 IDEA 2019.1 with Java 11: cannot install on Win 10 from scratch
The trick with SetCurrentDirectory back and forth doesn't work because the missing dll can be requested asynchrounously (on loading awt.dll). So we can just add the right dir to the dll serach path instead.
This commit is contained in:
@@ -581,7 +581,6 @@ 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,15 +592,13 @@ bool LoadJVMLibrary()
|
||||
dllName = clientDllName;
|
||||
}
|
||||
|
||||
// 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());
|
||||
// ensure we can find msvcr<ver>.dll which is located in jre/bin directory; jvm.dll (awt.dll) depends on it.
|
||||
SetDllDirectoryA(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 ";
|
||||
|
||||
Reference in New Issue
Block a user