Changeset 6979 in josm for trunk/src


Ignore:
Timestamp:
2014-04-15T00:48:42+02:00 (11 years ago)
Author:
Don-vip
Message:

simplify Java version checking

File:
1 edited

Legend:

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

    r6957 r6979  
    11171117        String version = System.getProperty("java.version");
    11181118        if (version != null) {
    1119             if (version.startsWith("1.6") || version.startsWith("6") ||
    1120                     version.startsWith("1.7") || version.startsWith("7") ||
    1121                     version.startsWith("1.8") || version.startsWith("8") ||
    1122                     version.startsWith("1.9") || version.startsWith("9"))
     1119            if (version.matches("^(1\\.)?[6789].*"))
    11231120                return;
    1124             if (version.startsWith("1.5") || version.startsWith("5")) {
     1121            if (version.matches("^(1\\.)?[5].*")) {
    11251122                JMultilineLabel ho = new JMultilineLabel("<html>"+
    11261123                        tr("<h2>JOSM requires Java version 6.</h2>"+
     
    11411138                final String EXIT = tr("Exit JOSM");
    11421139                final String CONTINUE = tr("Continue, try anyway");
    1143                 int ret = JOptionPane.showOptionDialog(null, panel, tr("Error"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, new String[] {EXIT, CONTINUE}, EXIT);
     1140                int ret = JOptionPane.showOptionDialog(null, panel, tr("Error"), JOptionPane.YES_NO_OPTION,
     1141                        JOptionPane.ERROR_MESSAGE, null, new String[] {EXIT, CONTINUE}, EXIT);
    11441142                if (ret == 0) {
    11451143                    System.exit(0);
Note: See TracChangeset for help on using the changeset viewer.