forked from I2P_Developers/i2p.i2p
Java 10 test
This commit is contained in:
@ -45,6 +45,7 @@ public abstract class SystemVersion {
|
||||
private static final boolean _oneDotSeven;
|
||||
private static final boolean _oneDotEight;
|
||||
private static final boolean _oneDotNine;
|
||||
private static final boolean _oneDotTen;
|
||||
private static final int _androidSDK;
|
||||
|
||||
static {
|
||||
@ -85,10 +86,11 @@ public abstract class SystemVersion {
|
||||
if (_isAndroid) {
|
||||
_oneDotSix = _androidSDK >= 9;
|
||||
_oneDotSeven = _androidSDK >= 19;
|
||||
// https://developer.android.com/guide/platform/j8-jack.html
|
||||
// some stuff in 23, some in 24
|
||||
// https://developer.android.com/studio/write/java8-support.html
|
||||
// some stuff in 24
|
||||
_oneDotEight = false;
|
||||
_oneDotNine = false;
|
||||
_oneDotTen = false;
|
||||
} else {
|
||||
String version = System.getProperty("java.version");
|
||||
// handle versions like "8-ea" or "9-internal"
|
||||
@ -98,6 +100,8 @@ public abstract class SystemVersion {
|
||||
_oneDotSeven = _oneDotSix && VersionComparator.comp(version, "1.7") >= 0;
|
||||
_oneDotEight = _oneDotSeven && VersionComparator.comp(version, "1.8") >= 0;
|
||||
_oneDotNine = _oneDotEight && VersionComparator.comp(version, "1.9") >= 0;
|
||||
// Starting 2018, versions are YY.M, this works for that also
|
||||
_oneDotTen = _oneDotNine && VersionComparator.comp(version, "1.10") >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,13 +203,22 @@ public abstract class SystemVersion {
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true if Java 1.9 or higher, false for Android.
|
||||
* @return true if Java 9 or higher, false for Android.
|
||||
* @since 0.9.23
|
||||
*/
|
||||
public static boolean isJava9() {
|
||||
return _oneDotNine;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true if Java 10 or higher, false for Android.
|
||||
* @since 0.9.33
|
||||
*/
|
||||
public static boolean isJava10() {
|
||||
return _oneDotTen;
|
||||
}
|
||||
|
||||
/**
|
||||
* This isn't always correct.
|
||||
* http://stackoverflow.com/questions/807263/how-do-i-detect-which-kind-of-jre-is-installed-32bit-vs-64bit
|
||||
@ -294,6 +307,7 @@ public abstract class SystemVersion {
|
||||
System.out.println("Java 7 : " + isJava7());
|
||||
System.out.println("Java 8 : " + isJava8());
|
||||
System.out.println("Java 9 : " + isJava9());
|
||||
System.out.println("Java 10 : " + isJava10());
|
||||
System.out.println("Android : " + isAndroid());
|
||||
if (isAndroid())
|
||||
System.out.println(" Version: " + getAndroidVersion());
|
||||
|
Reference in New Issue
Block a user