33.7.0-jre jar declares Multi-Release: true but contains no META-INF/versions entries; crashes javac 9 / 10.0.1 (zipfs NPE)
envgap__google__guava-8614
01 / FAILURE SIGNATURE
As reported upstream
java.lang.NullPointerException
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
a69fa3f58587b64d660128a818d88c078d6ac396- Manifest
pom.xml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
google/guava #8614 · read the original issue
**Guava Version**: 33.7.0-jre
**Description**: The published guava-33.7.0-jre.jar declares `Multi-Release: true` in META-INF/MANIFEST.MF but contains no `META-INF/versions/` entries at all. guava-33.6.0-jre.jar contains `META-INF/versions/9/module-info.class`.
**Example**: such a jar crashes javac on JDK 9 (all 9.0.x) and JDK 10.0.1 when it is on the compile classpath, because jdk.zipfs `JarFileSystem.createVersionedLinks` has no null guard for the missing versions directory:
```
java.lang.NullPointerException
at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.getVersionMap(JarFileSystem.java:137)
at jdk.nio.zipfs.JarFileSystem.createVersionedLinks(JarFileSystem.java:112)
at jdk.nio.zipfs.JarFileSystem.<init>(JarFileSystem.java:85)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:517)
```
Standalone reproducer (JDK 9):
```java
import java.net.URI;
import java.nio.file.*;
import java.util.*;
public class Repro {
public static void main(String[] args) throws Exception {
Map<String, String> env = new HashMap<>();
env.put("multi-release", "9");
FileSystem fs = FileSystems.newFileSystem(URI.create("jar:" + Paths.get(args[0]).toUri()), env);
System.out.println("OK: " + args[0]);
}
}
```
- guava-33.6.0-jre.jar -> OK
- guava-33.7.0-jre.jar -> NPE at `JarFileSystem.getVersionMap(JarFileSystem.java:137)`
**Expected Behavior**: either the versions directory is present (as in 33.6.0-jre) or the Multi-Release manifest attribute is omitted.
**Actual Behavior**: 33.7.0-jre declares `Multi-Release: true` with no `META-INF/versions` entries, breaking javac 9 / 10.0.1 compilation for downstream builds (e.g. javaparser had to revert to 33.6.0-jre, see javaparser/javaparser#5095).
**Packages**: guava
**Platforms**: any JDK 9 / 10.0.1 runtime or javac (jdk.zipfs)
**Checklist**:
- [x] I agree to follow the [code of conduct](https://github.com/google/.github/blob/master/CODE_OF_CONDUCT.md).
- [x] I can reproduce the bug with the [latest](https://github.com/google/guava/releases/latest) version of Guava available.04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]