hg merge release-7.1 (merge release7.1 into default)

This commit is contained in:
Carlos Ruiz 2019-11-25 09:59:48 +01:00
commit 6efec8e637
1 changed files with 12 additions and 10 deletions

View File

@ -73,20 +73,22 @@ public class ConfigVM extends Config
System.setProperty(ConfigurationData.JAVA_HOME, javaHome.getAbsolutePath());
// Java Version
final String[] versions = new String[]{"1.7.0", "1.8.0", "9", "9.", "10", "10.", "11", "11.", "12", "12."};
pass = false;
String thisJV = System.getProperty("java.version");
for(String version : versions)
{
pass = thisJV.indexOf(version) != -1;
int pointPos = thisJV.indexOf(".");
int thisJVint = 0;
if (pointPos >= 0)
thisJVint = Integer.valueOf(thisJV.substring(0, pointPos));
else
thisJVint = Integer.valueOf(thisJV);
int minSupportedVersion = 11;
pass = thisJVint >= minSupportedVersion;
if (pass)
{
if (log.isLoggable(Level.INFO)) log.info("OK: Version=" + thisJV);
break;
}
}
error = "Wrong Java Version: Should be " + versions[0] + " and above.";
error = "Wrong Java Version = " + thisJV + ": Should be " + minSupportedVersion + " and above.";
if (getPanel() != null)
signalOK(getPanel().okJavaHome, "ErrorJavaHome",
pass, true, error);