diff --git a/junit-jdk8.patch b/junit-jdk8.patch
new file mode 100644
index 0000000..a44b70d
--- /dev/null
+++ b/junit-jdk8.patch
@@ -0,0 +1,41 @@
+Index: junit-r4.11/src/main/java/org/junit/runners/model/FrameworkMethod.java
+===================================================================
+--- junit-r4.11.orig/src/main/java/org/junit/runners/model/FrameworkMethod.java
++++ junit-r4.11/src/main/java/org/junit/runners/model/FrameworkMethod.java
+@@ -83,14 +83,11 @@ public class FrameworkMethod extends Fra
+ *
is not static (given {@code isStatic is true}).
+ */
+ public void validatePublicVoid(boolean isStatic, List errors) {
+- if (Modifier.isStatic(fMethod.getModifiers()) != isStatic) {
++ if (isStatic() != isStatic) {
+ String state = isStatic ? "should" : "should not";
+ errors.add(new Exception("Method " + fMethod.getName() + "() " + state + " be static"));
+ }
+- if (!Modifier.isPublic(fMethod.getDeclaringClass().getModifiers())) {
+- errors.add(new Exception("Class " + fMethod.getDeclaringClass().getName() + " should be public"));
+- }
+- if (!Modifier.isPublic(fMethod.getModifiers())) {
++ if (!isPublic()) {
+ errors.add(new Exception("Method " + fMethod.getName() + "() should be public"));
+ }
+ if (fMethod.getReturnType() != Void.TYPE) {
+Index: junit-r4.11/src/test/java/org/junit/tests/AllTests.java
+===================================================================
+--- junit-r4.11.orig/src/test/java/org/junit/tests/AllTests.java
++++ junit-r4.11/src/test/java/org/junit/tests/AllTests.java
+@@ -77,7 +77,6 @@ import org.junit.tests.running.methods.T
+ import org.junit.tests.running.methods.TimeoutTest;
+ import org.junit.tests.validation.BadlyFormedClassesTest;
+ import org.junit.tests.validation.FailedConstructionTest;
+-import org.junit.tests.validation.InaccessibleBaseClassTest;
+ import org.junit.tests.validation.ValidationTest;
+
+ // These test files need to be cleaned. See
+@@ -118,7 +117,6 @@ import org.junit.tests.validation.Valida
+ JUnit38ClassRunnerTest.class,
+ SystemExitTest.class,
+ JUnitCoreReturnsCorrectExitCodeTest.class,
+- InaccessibleBaseClassTest.class,
+ SuiteMethodTest.class,
+ BadlyFormedClassesTest.class,
+ IgnoreClassTest.class,
diff --git a/junit.changes b/junit.changes
index 5ff4b4a..69522b5 100644
--- a/junit.changes
+++ b/junit.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Tue Jul 28 07:53:29 UTC 2015 - tchvatal@suse.com
+
+- Add patch to build with jdk8:
+ * junit-jdk8.patch
+
-------------------------------------------------------------------
Wed Mar 18 09:46:15 UTC 2015 - tchvatal@suse.com
diff --git a/junit.spec b/junit.spec
index c98a9be..30057b5 100644
--- a/junit.spec
+++ b/junit.spec
@@ -28,6 +28,8 @@ Source0: https://github.com/junit-team/junit/archive/r%{version}.tar.gz
Source1: junit-4.11.pom
#PATCH-FIX-OPENSUSE: do not use bundled hamcrest sources, which btw fixes hamcrest build with junit4
Patch0: junit-no-hamcrest-src.patch
+#PATCH-FIX-UPSTREAM: build with jdk8 and newer, already in upstream repo
+Patch1: junit-jdk8.patch
BuildRequires: ant
BuildRequires: hamcrest >= 1.3
BuildRequires: java-devel >= 1.6.0
@@ -79,15 +81,13 @@ Demos for %{name}.
%prep
%setup -q -n junit-r%{version}
%patch0 -p1
+%patch1 -p1
find . -type f -name "*.jar" -or -name "*.class" | xargs -t rm -rf
ln -s $(build-classpath hamcrest/core) lib/hamcrest-core-1.3.jar
%build
-#export CLASSPATH=
-#export OPT_JAR_LIST=:
-#ant -Dant.build.javac.source=1.5 dist
ant dist -Dversion-status=
%install