Index: trunk/linux/latest/usr/bin/josm-latest
===================================================================
--- trunk/linux/latest/usr/bin/josm-latest	(revision 8776)
+++ trunk/linux/latest/usr/bin/josm-latest	(revision 8777)
@@ -12,7 +12,9 @@
 # If OpenJDK is only available headless, do not try it
 if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
+	JAVA9_CMDS="/usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java /usr/lib/jvm/java-9-oracle/bin/java"
 	JAVA8_CMDS="/usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java /usr/lib/jvm/java-8-oracle/bin/java"
 	JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
 else
+	JAVA9_CMDS="/usr/lib/jvm/java-9-oracle/bin/java"
 	JAVA8_CMDS="/usr/lib/jvm/java-8-oracle/bin/java"
 	JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
@@ -45,4 +47,16 @@
 done
 
+for jcmd in $JAVA9_CMDS; do
+	if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
+        JAVACMD="$jcmd"
+    fi
+done
+
+for jcmd in $JAVA9_CMDS; do
+    if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
+        JAVACMD="$jcmd"
+    fi
+done
+
 if [ "$JAVACMD" ]; then
     echo "Using $JAVACMD to execute josm-latest." || true
Index: trunk/linux/tested/usr/bin/josm
===================================================================
--- trunk/linux/tested/usr/bin/josm	(revision 8776)
+++ trunk/linux/tested/usr/bin/josm	(revision 8777)
@@ -12,7 +12,9 @@
 # If OpenJDK is only available headless, do not try it
 if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
+	JAVA9_CMDS="/usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java /usr/lib/jvm/java-9-oracle/bin/java"
 	JAVA8_CMDS="/usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java /usr/lib/jvm/java-8-oracle/bin/java"
 	JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
 else
+	JAVA9_CMDS="/usr/lib/jvm/java-9-oracle/bin/java"
 	JAVA8_CMDS="/usr/lib/jvm/java-8-oracle/bin/java"
 	JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
@@ -45,4 +47,16 @@
 done
 
+for jcmd in $JAVA9_CMDS; do
+	if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
+        JAVACMD="$jcmd"
+    fi
+done
+
+for jcmd in $JAVA9_CMDS; do
+    if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
+        JAVACMD="$jcmd"
+    fi
+done
+
 if [ "$JAVACMD" ]; then
     echo "Using $JAVACMD to execute josm." || true
Index: trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java	(revision 8776)
+++ trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java	(revision 8777)
@@ -24,5 +24,5 @@
             return Collections.<Relation>emptySet();
         } else {
-            return new SubclassFilteredCollection<>(
+            return new SubclassFilteredCollection<OsmPrimitive, Relation>(
                     primitives, OsmPrimitive.relationPredicate);
         }
Index: trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java	(revision 8776)
+++ trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java	(revision 8777)
@@ -25,5 +25,5 @@
      * All primitives, that are affected with this command.
      */
-    private final List<OsmPrimitive> objects;
+    private final List<? extends OsmPrimitive> objects;
     /**
      * The key that is subject to change.
Index: trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 8776)
+++ trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 8777)
@@ -369,5 +369,5 @@
             return null;
 
-        Set<OsmPrimitive> primitivesToDelete = new HashSet<>(selection);
+        Set<OsmPrimitive> primitivesToDelete = new HashSet<OsmPrimitive>(selection);
 
         Collection<Relation> relationsToDelete = Utils.filteredCollection(primitivesToDelete, Relation.class);
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 8776)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 8777)
@@ -381,5 +381,5 @@
     public Command fixError(TestError testError) {
         if (!isFixable(testError)) return null;
-        Collection<OsmPrimitive> sel = new LinkedList<>(testError.getPrimitives());
+        Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>(testError.getPrimitives());
         Set<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class));
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 8776)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 8777)
@@ -302,5 +302,5 @@
                 }
             }
-            List<OsmPrimitive> newPrimitives = new ArrayList<>(primitives);
+            List<OsmPrimitive> newPrimitives = new ArrayList<OsmPrimitive>(primitives);
             newPrimitives.add(0, r);
             error.setPrimitives(newPrimitives);
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java	(revision 8776)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java	(revision 8777)
@@ -108,5 +108,6 @@
             E oldPrototype = getPrototypeDisplayValue();
             // Get internal JList to directly call the renderer
-            JList<E> list = getList();
+            @SuppressWarnings("rawtypes")
+            JList list = getList();
             try {
                 // Index to give to renderer
@@ -117,4 +118,5 @@
                         // but not with TaggingPreset custom renderer that return a dummy height if index is equal to -1
                         // So we explicitely call the renderer by simulating a correct index for the current value
+                        @SuppressWarnings("unchecked")
                         Component c = getRenderer().getListCellRendererComponent(list, value, i, true, true);
                         if (c != null) {
@@ -139,5 +141,5 @@
 
     @SuppressWarnings("unchecked")
-    protected final JList<E> getList() {
+    protected final JList<Object> getList() {
         for (int i = 0; i < getUI().getAccessibleChildrenCount(this); i++) {
             Accessible child = getUI().getAccessibleChild(this, i);
@@ -158,5 +160,5 @@
             // If possible, adjust the maximum number of items with the real height of items
             // It is not granted this works on every platform (tested OK on Windows)
-            JList<E> list = getList();
+            JList<Object> list = getList();
             if (list != null) {
                 if (!prototype.equals(list.getPrototypeCellValue())) {
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 8776)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 8777)
@@ -131,5 +131,5 @@
 
     public static <T> Collection<T> filter(Collection<? extends T> collection, Predicate<? super T> predicate) {
-        return new FilteredCollection<>(collection, predicate);
+        return new FilteredCollection<T>(collection, predicate);
     }
 
