Changeset 10786 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-08-11T21:54:24+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r10759 r10786 6 6 import java.awt.BorderLayout; 7 7 import java.awt.Component; 8 import java.awt.GridBagConstraints;9 import java.awt.GridBagLayout;10 8 import java.awt.Window; 11 9 import java.awt.event.KeyEvent; … … 47 45 import javax.swing.JOptionPane; 48 46 import javax.swing.JPanel; 49 import javax.swing.JTextArea;50 47 import javax.swing.KeyStroke; 51 48 import javax.swing.LookAndFeel; … … 83 80 import org.openstreetmap.josm.gui.MapFrame; 84 81 import org.openstreetmap.josm.gui.MapFrameListener; 85 import org.openstreetmap.josm.gui.help.HelpUtil;86 82 import org.openstreetmap.josm.gui.io.SaveLayersDialog; 87 83 import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer; … … 99 95 import org.openstreetmap.josm.gui.util.GuiHelper; 100 96 import org.openstreetmap.josm.gui.util.RedirectInputMap; 101 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;102 97 import org.openstreetmap.josm.io.FileWatcher; 103 98 import org.openstreetmap.josm.io.OnlineResource; … … 1304 1299 } 1305 1300 1306 /**1307 * Checks that JOSM is at least running with Java 8.1308 * @since 70011309 */1310 public static void checkJavaVersion() {1311 String version = System.getProperty("java.version");1312 if (version != null) {1313 if (version.matches("^(1\\.)?[89].*"))1314 return;1315 if (version.matches("^(1\\.)?[567].*")) {1316 JMultilineLabel ho = new JMultilineLabel("<html>"+1317 tr("<h2>JOSM requires Java version {0}.</h2>"+1318 "Detected Java version: {1}.<br>"+1319 "You can <ul><li>update your Java (JRE) or</li>"+1320 "<li>use an earlier (Java {2} compatible) version of JOSM.</li></ul>"+1321 "More Info:", "8", version, "7")+"</html>");1322 JTextArea link = new JTextArea(HelpUtil.getWikiBaseHelpUrl()+"/Help/SystemRequirements");1323 link.setEditable(false);1324 link.setBackground(panel.getBackground());1325 JPanel panel = new JPanel(new GridBagLayout());1326 GridBagConstraints gbc = new GridBagConstraints();1327 gbc.gridwidth = GridBagConstraints.REMAINDER;1328 gbc.anchor = GridBagConstraints.WEST;1329 gbc.weightx = 1.0;1330 panel.add(ho, gbc);1331 panel.add(link, gbc);1332 final String exitStr = tr("Exit JOSM");1333 final String continueStr = tr("Continue, try anyway");1334 int ret = JOptionPane.showOptionDialog(null, panel, tr("Error"), JOptionPane.YES_NO_OPTION,1335 JOptionPane.ERROR_MESSAGE, null, new String[] {exitStr, continueStr}, exitStr);1336 if (ret == 0) {1337 System.exit(0);1338 }1339 return;1340 }1341 }1342 error("Could not recognize Java Version: "+version);1343 }1344 1345 1301 /* ----------------------------------------------------------------------------------------- */ 1346 1302 /* projection handling - Main is a registry for a single, global projection instance */ -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r10755 r10786 298 298 public static void main(final String[] argArray) { 299 299 I18n.init(); 300 Main.checkJavaVersion();301 300 302 301 // construct argument table
Note:
See TracChangeset
for help on using the changeset viewer.