aboutsummaryrefslogtreecommitdiff
path: root/launcher/JavaCommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/JavaCommon.cpp')
-rw-r--r--launcher/JavaCommon.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/launcher/JavaCommon.cpp b/launcher/JavaCommon.cpp
index a6542fa7..17278d86 100644
--- a/launcher/JavaCommon.cpp
+++ b/launcher/JavaCommon.cpp
@@ -17,6 +17,17 @@ bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent)
QMessageBox::Warning)->exec();
return false;
}
+ // block lunacy with passing required version to the JVM
+ if (jvmargs.contains(QRegExp("-version:.*"))) {
+ auto warnStr = QObject::tr(
+ "You tried to pass required Java version argument to the JVM (using \"-version:xxx\"). This is not safe and will not be allowed.\n"
+ "This message will be displayed until you remove this from the JVM arguments.");
+ CustomMessageBox::selectable(
+ parent, QObject::tr("JVM arguments warning"),
+ warnStr,
+ QMessageBox::Warning)->exec();
+ return false;
+ }
return true;
}