win launcher: updated create JVM error message.

IDEA-189436 IDEA fails to launch with JDK 10 set as IDEA_JDK_64.
This commit is contained in:
Vladimir.Orlov
2018-04-12 14:14:47 +03:00
parent 604b39103d
commit e8069bd1f0
3 changed files with 18 additions and 3 deletions
Binary file not shown.
Binary file not shown.
+18 -3
View File
@@ -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);
}