Ignore:
Timestamp:
2017-05-13T00:56:58+02:00 (7 years ago)
Author:
Don-vip
Message:

see #11924 - do not try old workaround with java 9 (pollutes console with stacktrace)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r12015 r12130  
    15861586        return angleDeg * TO_RADIANS;
    15871587    }
     1588
     1589    /**
     1590     * Returns the Java version as an int value.
     1591     * @return the Java version as an int value (8, 9, etc.)
     1592     * @since 12130
     1593     */
     1594    public static int getJavaVersion() {
     1595        String version = System.getProperty("java.version");
     1596        if (version.startsWith("1.")) {
     1597            version = version.substring(2);
     1598        }
     1599        // Allow these formats:
     1600        // 1.8.0_72-ea
     1601        // 9-ea
     1602        // 9
     1603        // 9.0.1
     1604        int dotPos = version.indexOf('.');
     1605        int dashPos = version.indexOf('-');
     1606        return Integer.parseInt(version.substring(0,
     1607                dotPos > -1 ? dotPos : dashPos > -1 ? dashPos : 1));
     1608    }
    15881609}
Note: See TracChangeset for help on using the changeset viewer.