public final class JavaFeatureVersion
extends Object
The Java feature version of the running VM, e.g. 17 (GROOVY-12382).
Runtime.version() is a Java 9 API that some runtimes built on the
JDK class library do not provide (Android's ART, for one). Where it is
missing, the java.specification.version property is parsed instead,
and when that is unusable the lowest release Groovy supports is assumed.
Deliberately tiny and free of lambdas: it is consulted from static
initialisers that can run while the system class loader is being
instantiated (-Djava.system.class.loader=groovy.lang.GroovyClassLoader),
where an invokedynamic bootstrap is not yet permitted, and it must
not trigger the creation of the VM plugin.
| Modifiers | Name | Description |
|---|---|---|
static int |
MINIMUM |
The lowest Java release Groovy runs on. |
Returns the feature version of the running VM.
Parses a java.specification.version value ("1.8",
"17", "0.9" on Android) into a feature version.
specificationVersion - the property value, possibly nullminimum - the value returned when the property is missing, unparseable or below it