Changeset 51e35eb for core


Ignore:
Timestamp:
Oct 28, 2016 3:08:13 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
95ae86d
Parents:
4f0cae5
Message:

Utils: Handle Java version detection for internal or ea versions

File:
1 edited

Legend:

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

    r4f0cae5 r51e35eb  
    7171            _oneDotSix = _androidSDK >= 9;
    7272            _oneDotSeven = _androidSDK >= 19;
     73            // https://developer.android.com/guide/platform/j8-jack.html
     74            // some stuff in 23, some in 24
    7375            _oneDotEight = false;
    7476            _oneDotNine = false;
    7577        } else {
    76             _oneDotSix = VersionComparator.comp(System.getProperty("java.version"), "1.6") >= 0;
    77             _oneDotSeven = _oneDotSix && VersionComparator.comp(System.getProperty("java.version"), "1.7") >= 0;
    78             _oneDotEight = _oneDotSeven && VersionComparator.comp(System.getProperty("java.version"), "1.8") >= 0;
    79             _oneDotNine = _oneDotEight && VersionComparator.comp(System.getProperty("java.version"), "1.9") >= 0;
     78            String version = System.getProperty("java.version");
     79            // handle versions like "8-ea" or "9-internal"
     80            if (!version.startsWith("1."))
     81                version = "1." + version;
     82            _oneDotSix = VersionComparator.comp(version, "1.6") >= 0;
     83            _oneDotSeven = _oneDotSix && VersionComparator.comp(version, "1.7") >= 0;
     84            _oneDotEight = _oneDotSeven && VersionComparator.comp(version, "1.8") >= 0;
     85            _oneDotNine = _oneDotEight && VersionComparator.comp(version, "1.9") >= 0;
    8086        }
    8187    }
Note: See TracChangeset for help on using the changeset viewer.