diff --git a/debian/changelog b/debian/changelog
index 326cba4..c5e9cd8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@
and invalid-short-name-in-dep5-copyright in debian/copyright.
[ Emmanuel Bourg ]
+ * Fixed the build failure with Java 9 (Closes: #875418)
* Build with the DH sequencer instead of CDBS
* Moved the package to Git
* Standards-Version updated to 4.1.3
diff --git a/debian/patches/02_fix_generic_ftbfs.patch b/debian/patches/02_fix_generic_ftbfs.patch
index faf9a85..bcbd4c8 100644
--- a/debian/patches/02_fix_generic_ftbfs.patch
+++ b/debian/patches/02_fix_generic_ftbfs.patch
@@ -1,7 +1,5 @@
-Index: java3d-1.5.2+dfsg/j3d-core/build.xml
-===================================================================
---- java3d-1.5.2+dfsg.orig/j3d-core/build.xml 2010-01-09 18:52:55.000000000 +0530
-+++ java3d-1.5.2+dfsg/j3d-core/build.xml 2010-01-09 20:24:13.000000000 +0530
+--- a/j3d-core/build.xml
++++ b/j3d-core/build.xml
@@ -196,6 +196,15 @@
@@ -41,10 +39,8 @@
-Index: java3d-1.5.2+dfsg/j3d-core/src/native/build.xml
-===================================================================
---- java3d-1.5.2+dfsg.orig/j3d-core/src/native/build.xml 2010-01-09 18:52:55.000000000 +0530
-+++ java3d-1.5.2+dfsg/j3d-core/src/native/build.xml 2010-01-09 20:23:04.000000000 +0530
+--- a/j3d-core/src/native/build.xml
++++ b/j3d-core/src/native/build.xml
@@ -45,6 +45,13 @@
@@ -91,10 +87,8 @@
-Index: java3d-1.5.2+dfsg/j3d-core/src/native/ogl/build-linux-generic.xml
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ java3d-1.5.2+dfsg/j3d-core/src/native/ogl/build-linux-generic.xml 2010-01-09 20:23:04.000000000 +0530
+--- /dev/null
++++ b/j3d-core/src/native/ogl/build-linux-generic.xml
@@ -0,0 +1,74 @@
+
+
@@ -121,13 +115,13 @@
+
+
+
-+
-+
++
++
+
+
+
+
-+
++
+
+
+
@@ -135,7 +129,7 @@
+
+
+
-+
++
+
+
+
diff --git a/debian/patches/07_java9_compatibility.patch b/debian/patches/07_java9_compatibility.patch
new file mode 100644
index 0000000..cfdacb3
--- /dev/null
+++ b/debian/patches/07_java9_compatibility.patch
@@ -0,0 +1,72 @@
+Description: Fixes the build failure with Java 9 caused by the new layout of the JDK directory
+Author: Emmanuel Bourg
+Forwarded: no
+--- a/j3d-core/src/native/ogl/build-linux-amd64.xml
++++ b/j3d-core/src/native/ogl/build-linux-amd64.xml
+@@ -25,12 +25,12 @@
+
+
+
+-
++
+
+
+
+
+-
++
+
+
+
+@@ -38,7 +38,7 @@
+
+
+
+-
++
+
+
+
+--- a/j3d-core/src/native/ogl/build-linux-i586.xml
++++ b/j3d-core/src/native/ogl/build-linux-i586.xml
+@@ -25,12 +25,12 @@
+
+
+
+-
++
+
+
+
+
+-
++
+
+
+
+@@ -38,7 +38,7 @@
+
+
+
+-
++
+
+
+
+--- a/j3d-core/src/native/ogl/build-linux-ppc.xml
++++ b/j3d-core/src/native/ogl/build-linux-ppc.xml
+@@ -23,12 +23,12 @@
+
+
+
+-
++
+
+
+
+
+-
++
+
+
+
diff --git a/debian/patches/series b/debian/patches/series
index aedaeb5..e557623 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
05_pic_i586.patch
06_java-compat.patch
typedef.patch
+07_java9_compatibility.patch