Closed derklaro closed 2 years ago
What about using java.specification.version
? That should give 1.6
, 1.7
, 1.8
, 9
, ..., 18
.
What about using
java.specification.version
? That should give1.6
,1.7
,1.8
,9
, ...,18
.
If i read the [docs](https://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties()) correctly that property was added in [Java 7](https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getProperties())...
This also resolves issues when running with a newer java version than 17. (In my case 18-ea) which results in an exception when starting:
Exception in thread "main" java.lang.NumberFormatException: For input string: "18-ea"