public final class SystemUtils extends Object
Helpers for java.lang.System
.
If a system property cannot be read due to security restrictions,
the corresponding field in this class will be set to null
and a message will be written to System.err
.
Modifier and Type | Field and Description |
---|---|
static String |
JAVA_VERSION
The
java.version System Property. |
static float |
JAVA_VERSION_FLOAT
Gets the Java version as a
float . |
static String |
JAVA_VERSION_TRIMMED
Gets the Java version as a
String trimming leading letters. |
Modifier and Type | Method and Description |
---|---|
static boolean |
isJavaVersionAtLeast(float requiredVersion)
Is the Java version at least the requested version.
|
public static final String JAVA_VERSION
The java.version
System Property. Java version number.
Defaults to null
if the runtime does not have
security access to read this property or the property does not exist.
This value is initialized when the class is loaded. If System.setProperty(String,String)
or System.setProperties(java.util.Properties)
is called after this class is loaded, the value
will be out of sync with that System property.
public static final String JAVA_VERSION_TRIMMED
Gets the Java version as a String
trimming leading letters.
The field will return null
if JAVA_VERSION
is null
.
public static final float JAVA_VERSION_FLOAT
Gets the Java version as a float
.
Example return values:
1.2f
for JDK 1.2
1.31f
for JDK 1.3.1
The field will return zero if JAVA_VERSION
is null
.
public static boolean isJavaVersionAtLeast(float requiredVersion)
Is the Java version at least the requested version.
Example input:
1.2f
to test for JDK 1.21.31f
to test for JDK 1.3.1requiredVersion
- the required version, for example 1.31ftrue
if the actual version is equal or greater
than the required versionCopyright © 2025 Open Identity Platform Community. All rights reserved.