JMRI: Java Version-Specific FeaturesThis page contains information about the compatibility and features of various Java versions. We use this information to decide on our road map for future JMRI versions. (This page is a bit long, and perhaps overdue for a "historical" page)
CapabilitiesThis section lists new Java capabilities, and which Java version they first appeared in. The "JDK" column shows the first Java Development Kit that could compile the feature; the "JRE" column lists the first runtime environment that could run the feature, including the needed JVM and library support.
|HiDPI graphics support for Windows and Linux users. Probably "just works" with JRE update, unless something in JMRI breaks on Java 9 on Windows (Currently support using very large fonts as a workaround, but it quickly breaks as text overlaps widget boundaries)||1.8?||1.9|
|It seems that MacOS X (macOS) users will lose the use of the OS X App menu for About, Preferences, and (critically) Quit handling on that platform||1.9||1.9|
|It seems that MacOS X (macOS) users will lose Applescript scripting||1.9||1.9|
|Generics for Swing classes||1.7||1.7|
|NIO improves .zip file access||1.7||1.7|
|I18N I/O improvements||1.7||1.7|
|Memory use and
|Jetty Version 9||1.7||1.7|
|JUnit 4 and the
|Drag and Drop||1.4 (additional
improvements in 1.6)
|Logging API||1.4 (additional
improvements in 1.6)
|XML catalog resolver||1.3?||1.4?|
JRE availabilityThis section lists the most recent Java Runtime version available for various operating system versions. Please note that not all users of that operating system will have updated to this Java version; many will be using an older one.
Oracle's page on Java 1.7 requirements which says "Note: As of April 8, 2014 Microsoft stopped supporting Windows XP and therefore it is no longer a supported platform." Google finds numerous pages that show how to install Java 1.7 on XP or XP SP2.
Java 9 is not released yet, but pre-release information is available on the supported platforms page.
|OS and platform||Last JRE|
|Win 8 (32-bit)||1.8|
|Win 7 (32-bit)||1.8|
|Win Vista (32-bit)||1.8|
|Win Server 2008 (32-bit)||1.8|
|Win Web Server 2008 (32-bit)||1.6|
|Win 2000 (32-bit)||1.6|
|Win Server 2003 (32-bit)||1.6|
|Win 8 (64-bit)||1.8|
|Win Server 2012 (64-bit)||1.8|
|Win Server 2012 R2 (64-bit)||1.8|
|Win 7 (64-bit)||1.8|
|Win Server 2008 R2 (64-bit)||1.8|
|Win Server 2008 (64-bit)||1.7|
|Win Web Server 2008 R2 (64-bit)||1.6|
|Win Vista (64-bit)||1.8|
|Win 2003 (64-bit)||1.6|
|Windows 98 (2nd Ed)||1.5-11|
|Mac OS X 10.8.3 and later on Intel||1.8|
|Mac OS X 10.7.3 and later on Intel||1.7|
|Mac OS X 10.5.8 and later on Intel||1.6 (Apple JVM)|
|Mac OS X 10.5.7 and earlier on Intel||1.5 (Apple JVM)|
|Mac OS X 10.3 and later on PowerPC||1.5 (Apple JVM)|
The following combination of JMRI - Java - Platform/OS versions was based on Oracle and OS developers sources. It's translated to the OS install instructions (follow hyperlink in OS headers):
|4.2||1.8||10.8.3+ Mountain Lion||Win7 SP1/8/10, Vista SP2, (XP)||5.5+||12.04+||14.04LTS|
|3.10.1||1.7||10.7.3 Lion||Win7 SP1/8/10, Vista SP2, (XP)||5.5+||12.04||12.04|
|3.10.1||1.6||10.6 Snow Leopard (JVM6)||Win2003, Win2000 (x86)||5.5||10.4||N/A|
|2.14.1||1.5||10.5.7 Leopard (JVM5)||Vista SP1, Win2000 SP3, Win8.x (x64)||9.04||N/A|
|2.8||1.5||10.4 Tiger||Win98 (2nd Ed), XP, ME||N/A|
|2.2||1.5||10.3 Panther||Win98, ME||N/A||N/A||N/A|
|1.3.1||10.3 Panther||Win95, Win98||N/A||N/A||N/A|
|1.6||1.1.8||MacOS9.1 (MRJ)||Win95, Win98||N/A||N/A||N/A|
Moving to Java 1.8 from 1.6This section discusses, roughly in order of decreasing importance, the process of migrating from Java 1.6 to Java 1.8.
Generics, Swing and JComboBoxJava 1.8 introduces generics for Swing objects. The most common one is JComboBox. This Java 1.6 line:
JComboBox box = new JComboBox();describes the creation of a JComboBox that selects generic (Object) items.
In Java 1.8, the JComboBox holds and selects objects of a specific type, usually String. It's written:
JComboBox<String> box = new JComboBox<>();The most common code for getting the selected item still includes a cast:
String result = (String)box.getSelectedItem();because the JComboBox can actually contain objects of other types (How can this happen? If the box is editable, and somebody enters some other type).
To avoid the case, a more robust idiom is:
String result = box.getItemAt(progBox.getSelectedIndex());
Javadoc and doclintJava 1.8 by default runs the doclint doclet when making Javadoc. By default, it is very aggressive on possible errors. The default Ant-based builds turn off some of the checking terms with
-Xdoclint:all,-missing,-accessibility,-html,-syntaxto drop tests for missing Javadoc tags and certain benign HTML errors. (For now)
JVM and JDK ExtensionsIt's possible to extend the JVM and/or JDK installed on your machine via the endorsed-standards override mechanism and the extension mechanism. Those extensions, if present, take precedence over code shipped with applications like JMRI. Unfortunately, these can cause problems if the installed extensions interfere with a JMRI component. For example, an older (or younger) version might not be compatible, etc. It is very unusual for this to cause a problem with JMRI. You should investigate other possible causes before looking into this one! To check for this, execute the following from the command line:
java -XX:+CheckEndorsedAndExtDirsIf you get a message about a specific directory, look there for conflicting Jar files. You should probably consult the JMRIusers or jmri-developers mailing list for help before changing that directory!