diff --git a/README.md b/README.md
index 60d1b2ce..65af8726 100644
--- a/README.md
+++ b/README.md
@@ -46,9 +46,9 @@ Building with Apache Ant
* If you are using OpenJDK version older than 9:
- Comment the `sourcever9` line in the file `build.properties`.
- When it is commented, `module-info.java` and other files
- requiring Java 9 won't be built. `xz.jar` won't be a modular JAR.
+ To build with OpenJDK 8, use `-Djava8only=true` on the `ant`
+ command line. Then the files requiring Java >= 9 won't be built,
+ and `xz.jar` won't be a modular JAR.
* If you are using OpenJDK version older than 8:
diff --git a/build.properties b/build.properties
index fc24e3b9..4f6c63f3 100644
--- a/build.properties
+++ b/build.properties
@@ -14,14 +14,12 @@ debug = true
#
# sourcever9 does the same as sourcever but for files that require Java 9 or
# later. The resulting classes are packaged as multi-release JAR, including
-# module-info.java. If sourcever9 is commented out, these files won't be
-# built but the package will still work.
+# module-info.java.
#
-# If you need to build this on OpenJDK 8:
-# - Set sourcever = 8
-# - Comment the sourcever9 line below to disable building Java 9 files.
+# To build with OpenJDK 8, use -Djava8only=true on the ant command line.
sourcever = 8
sourcever9 = 9
+java8only = false
# If true, javadoc is called with en_US locale to force the headings and
# such strings from javadoc to be in English, independent of the system
diff --git a/build.xml b/build.xml
index 9635ff12..bce9977a 100644
--- a/build.xml
+++ b/build.xml
@@ -55,18 +55,13 @@
-
-
-
-
-
-
-
+
+ includesfile="fileset-src9.txt">
@@ -79,14 +74,14 @@
+ unless:true="${java8only}"/>
+ unless:true="${java8only}"/>