Changeset 789f15f


Ignore:
Timestamp:
Dec 11, 2017 11:41:19 AM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
34d879a
Parents:
b04924d
Message:

Java 10 test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/SystemVersion.java

    rb04924d r789f15f  
    4646    private static final boolean _oneDotEight;
    4747    private static final boolean _oneDotNine;
     48    private static final boolean _oneDotTen;
    4849    private static final int _androidSDK;
    4950
     
    8687            _oneDotSix = _androidSDK >= 9;
    8788            _oneDotSeven = _androidSDK >= 19;
    88             // https://developer.android.com/guide/platform/j8-jack.html
    89             // some stuff in 23, some in 24
     89            // https://developer.android.com/studio/write/java8-support.html
     90            // some stuff in 24
    9091            _oneDotEight = false;
    9192            _oneDotNine = false;
     93            _oneDotTen = false;
    9294        } else {
    9395            String version = System.getProperty("java.version");
     
    99101            _oneDotEight = _oneDotSeven && VersionComparator.comp(version, "1.8") >= 0;
    100102            _oneDotNine = _oneDotEight && VersionComparator.comp(version, "1.9") >= 0;
     103            // Starting 2018, versions are YY.M, this works for that also
     104            _oneDotTen = _oneDotNine && VersionComparator.comp(version, "1.10") >= 0;
    101105        }
    102106    }
     
    200204    /**
    201205     *
    202      *  @return true if Java 1.9 or higher, false for Android.
     206     *  @return true if Java 9 or higher, false for Android.
    203207     *  @since 0.9.23
    204208     */
    205209    public static boolean isJava9() {
    206210        return _oneDotNine;
     211    }
     212
     213    /**
     214     *
     215     *  @return true if Java 10 or higher, false for Android.
     216     *  @since 0.9.33
     217     */
     218    public static boolean isJava10() {
     219        return _oneDotTen;
    207220    }
    208221
     
    295308        System.out.println("Java 8   : " + isJava8());
    296309        System.out.println("Java 9   : " + isJava9());
     310        System.out.println("Java 10  : " + isJava10());
    297311        System.out.println("Android  : " + isAndroid());
    298312        if (isAndroid())
Note: See TracChangeset for help on using the changeset viewer.