diff --git a/bin/WinLauncher/WinLauncher.exe b/bin/WinLauncher/WinLauncher.exe index 3596a30377f4..79f41d1324c8 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 c4b0a9b56068..7eeab4abec74 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 a58ce368ff91..7839a5c7c65f 100644 --- a/native/WinLauncher/WinLauncher/WinLauncher.cpp +++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp @@ -651,6 +651,16 @@ void SetProcessDPIAwareProperty() } } +std::string getErrorMessage(int errorCode) +{ + std::string errorMessage = ""; + if (errorCode == -6) + { + errorMessage = "MaxJavaStackTraceDepth=-1 is outside the allowed range [ 0 ... 1073741823 ].\nImproperly specified VM option 'MaxJavaStackTraceDepth=-1'\n"; + } + return errorMessage; +} + bool CreateJVM() { JavaVMInitArgs initArgs; @@ -671,10 +681,15 @@ bool CreateJVM() if (result != JNI_OK) { std::stringstream buf; + std::string jvmError = getErrorMessage(result); + if (jvmError == "") { + jvmError = "If you already have a " BITS_STR " JDK installed, define a JAVA_HOME variable in \n"; + jvmError += "Computer > System Properties > System Settings > Environment Variables.\n"; + } - buf << "Failed to create JVM: error code " << result << ".\n"; - buf << "JVM Path: " << jvmPath << "\n"; - buf << "Most likely the cause of the problem is incorrect settings in the VM options file."; + buf << jvmError; + buf << "\nFailed to create JVM. "; + buf << "JVM Path: " << jvmPath; std::string error = LoadStdString(IDS_ERROR_LAUNCHING_APP); MessageBoxA(NULL, buf.str().c_str(), error.c_str(), MB_OK); }