Allow config of sysprop used to get Java version.
For example: java_version_prop = java.runtime.version java_version_regex = (\d+)\.(\d+)\.(\d+)(_\d+)?(-b\d+)? Note: double backslashes are not needed in getdown.txt.
This commit is contained in:
@@ -560,6 +560,12 @@ public class Application
|
|||||||
throw new IOException("m.missing_class");
|
throw new IOException("m.missing_class");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check to see if we're using a custom java.version property and regex
|
||||||
|
vstr = (String)cdata.get("java_version_prop");
|
||||||
|
if (vstr != null) _javaVersionProp = vstr;
|
||||||
|
vstr = (String)cdata.get("java_version_regex");
|
||||||
|
if (vstr != null) _javaVersionRegex = vstr;
|
||||||
|
|
||||||
// check to see if we require a particular JVM version and have a supplied JVM
|
// check to see if we require a particular JVM version and have a supplied JVM
|
||||||
vstr = (String)cdata.get("java_version");
|
vstr = (String)cdata.get("java_version");
|
||||||
if (vstr != null) _javaMinVersion = parseLong(vstr, "m.invalid_java_version");
|
if (vstr != null) _javaMinVersion = parseLong(vstr, "m.invalid_java_version");
|
||||||
@@ -789,9 +795,8 @@ public class Application
|
|||||||
if (vmjar != null && vmjar.isMarkedValid()) return true;
|
if (vmjar != null && vmjar.isMarkedValid()) return true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// parse the version out of the java.version system property
|
// parse the version out of the java.version (or custom) system property
|
||||||
long version = SysProps.parseJavaVersion(
|
long version = SysProps.parseJavaVersion(_javaVersionProp, _javaVersionRegex);
|
||||||
"java.version", "(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?.*");
|
|
||||||
|
|
||||||
if (_javaExactVersionRequired) {
|
if (_javaExactVersionRequired) {
|
||||||
if (version == _javaMinVersion) return true;
|
if (version == _javaMinVersion) return true;
|
||||||
@@ -1720,6 +1725,8 @@ public class Application
|
|||||||
protected long _trackingStart;
|
protected long _trackingStart;
|
||||||
protected int _trackingId;
|
protected int _trackingId;
|
||||||
|
|
||||||
|
protected String _javaVersionProp = "java.version";
|
||||||
|
protected String _javaVersionRegex = "(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?.*";
|
||||||
protected long _javaMinVersion, _javaMaxVersion;
|
protected long _javaMinVersion, _javaMaxVersion;
|
||||||
protected boolean _javaExactVersionRequired;
|
protected boolean _javaExactVersionRequired;
|
||||||
protected String _javaLocation;
|
protected String _javaLocation;
|
||||||
|
|||||||
Reference in New Issue
Block a user