Closed davido closed 7 years ago
import java.io.DataInputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
public class Test {
public static void main(String[] args) throws IOException {
try (JarFile jf = new JarFile(args[0])) {
Enumeration<JarEntry> entries = jf.entries();
while (entries.hasMoreElements()) {
JarEntry je = entries.nextElement();
if (!je.getName().endsWith(".class")) {
continue;
}
DataInputStream dis = new DataInputStream(jf.getInputStream(je));
dis.readInt(); // magic
dis.readUnsignedShort(); // minor
int major = dis.readUnsignedShort();
if (major > 52) {
System.err.println(je.getName());
}
}
}
}
}
javac Test.java && java Test ~/.m2/repository/com/google/errorprone/javac/9-dev-r3297-3/javac-9-dev-r3297-3.jar
@cushon Thanks, that fixed the problem, but shouldn't this be fixed in EP distribution, in all-in-one JAR, so that the consumer must not massage the artifacts they got from the Central, like this: [1]?
@cushon What is your suggestion/opinion on how to address this problem? Would you see the fix in EP distribution in future releases that still claim to work against Java 8, to drop those classes? Or should consumers of EP set-up a script to patch all-in-one distribution artifact, in wich case a note in the README would be nice.
I'll take care of this in the next release, we shouldn't be distributing those class files.
Trying to use the latest EP release is failing on java 8, due to
javac-9-dev-r3297-3.jar
contains a few v53 class files, which asm doesn't support yet.The breakage is during
buck build buck
: [1].