JUnit does not run with JDK5 because it is compiled with JDK 6

Bug #283291 reported by Vladimir Korenev
4
Affects Status Importance Assigned to Milestone
junit (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

JUnit in Intrepid is compiled with JDK 6. It fails to run with JDK 5, which is included in Intrepid too.
Steps to reproduce:
1. Make java-1.5.0-sun JDK active.
2. Execute java -cp /usr/share/java/junit-3.8.2.jar junit.swingui.TestRunner.
The result is:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

Revision history for this message
marcelnijman (marcel-marcelnijman-deactivatedaccount) wrote :

The strange thing is that the original source can be compiled with java 1.4.2.
So why does the version in Interped enforce java 6?

http://ftp.de.debian.org/debian/pool/main/j/junit/junit_3.8.2.orig.tar.gz

Changed in junit:
status: New → Confirmed
Revision history for this message
Emmanuel Bourg (ebourg) wrote :

Java 9 is no longer able to generate Java 5 compatible bytecode and it'll be worse with every new Java release according to JEP 182. This means every time this package is rebuilt the runtime requirement becomes higher than previously. There is nothing we can do since we don't keep old compilers.

Changed in junit (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.