diff --git a/apache-commons-cli.changes b/apache-commons-cli.changes
index b9cddca..156c564 100644
--- a/apache-commons-cli.changes
+++ b/apache-commons-cli.changes
@@ -1,3 +1,11 @@
+-------------------------------------------------------------------
+Thu Sep 14 09:33:27 UTC 2017 - fstrba@suse.com
+
+- Added patch:
+ * commons-cli-1.2-jdk9.patch
+ - Specify java source and target level 1.6 in order to allow
+ building with jdk9
+
-------------------------------------------------------------------
Fri May 19 08:41:33 UTC 2017 - tchvatal@suse.com
diff --git a/apache-commons-cli.spec b/apache-commons-cli.spec
index 33d5fa5..dc17a68 100644
--- a/apache-commons-cli.spec
+++ b/apache-commons-cli.spec
@@ -27,6 +27,7 @@ Group: Development/Libraries/Java
Url: http://commons.apache.org/%{base_name}/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
Source1: build.xml.tar.bz2
+Patch0: commons-cli-1.2-jdk9.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: ant
@@ -53,8 +54,8 @@ Obsoletes: jakarta-%{short_name}-javadoc < %{version}
This package contains the API documentation for %{name}.
%prep
-%setup -q -n %{short_name}-%{version}-src
-tar -xf %{SOURCE1}
+%setup -q -n %{short_name}-%{version}-src -a1
+%patch0 -p1
%build
export CLASSPATH=$(build-classpath \
diff --git a/commons-cli-1.2-jdk9.patch b/commons-cli-1.2-jdk9.patch
new file mode 100644
index 0000000..726d338
--- /dev/null
+++ b/commons-cli-1.2-jdk9.patch
@@ -0,0 +1,70 @@
+--- commons-cli-1.2-src/maven-build.properties 2017-09-14 11:28:42.076085832 +0200
++++ commons-cli-1.2-src/maven-build.properties 2017-09-14 11:30:28.515332100 +0200
+@@ -2,7 +2,7 @@
+ #Tue Feb 01 23:35:00 MST 2011
+ commons.manifestfile=target/osgi/MANIFEST.MF
+ maven.settings.offline=true
+-maven.compile.target=1.4
++maven.compile.target=1.6
+ maven.build.finalName=commons-cli-1.2
+ commons.release.name=commons-cli-1.2
+ maven.build.resourceDir.0=.
+@@ -21,7 +21,7 @@
+ commons.osgi.import=*
+ commons.encoding=iso-8859-1
+ commons.osgi.symbolicName=org.apache.commons.cli
+-maven.compile.source=1.4
++maven.compile.source=1.6
+ organization.logo=http\://www.apache.org/images/asf_logo_wide.gif
+ commons.osgi.dynamicImport=
+ maven.build.testDir.0=src/test
+--- commons-cli-1.2-src/maven-build.xml 2017-09-14 11:28:42.076085832 +0200
++++ commons-cli-1.2-src/maven-build.xml 2017-09-14 11:30:13.055332041 +0200
+@@ -68,10 +68,10 @@
+ debug="true"
+ optimize="false"
+ deprecation="true"
+- target="1.4"
++ target="1.6"
+ verbose="false"
+ fork="false"
+- source="1.4">
++ source="1.6">
+
+
+
+@@ -101,10 +101,10 @@
+ debug="true"
+ optimize="false"
+ deprecation="true"
+- target="1.4"
++ target="1.6"
+ verbose="false"
+ fork="false"
+- source="1.4">
++ source="1.6">
+
+
+
+@@ -202,7 +202,7 @@
+ nonavbar="false"
+ serialwarn="false"
+ charset="ISO-8859-1"
+- source="1.4"
++ source="1.6"
+ linksource="true"
+ breakiterator="false">
+
+--- commons-cli-1.2-src/pom.xml 2017-09-14 11:28:42.076085832 +0200
++++ commons-cli-1.2-src/pom.xml 2017-09-14 11:30:04.343332008 +0200
+@@ -128,8 +128,8 @@
+
+
+
+- 1.4
+- 1.4
++ 1.6
++ 1.6
+ cli
+ 1.2
+ commons-cli-${commons.release.version}