lib/jrt-fs.jar is incompatible with Java 8

Bug #1727002 reported by trespasserw
This bug affects 27 people
Affects Status Importance Assigned to Milestone
Won't Fix
openjdk-9 (Debian)
Fix Released
openjdk-9 (Ubuntu)

Bug Description

A program running on Java 8 should be able to use the library to peek inside Java 9 (JEP 220 "Modular Run-Time Images" [1], section "New URI scheme ...").

Steps to reproduce:
1. Download an attached program
2. `apt install openjdk-8-jdk openjdk-9-jdk`
3. `/usr/lib/jvm/java-8-openjdk-amd64/bin/javac`
4. `/usr/lib/jvm/java-8-openjdk-amd64/bin/java ReadJrt /usr/lib/jvm/java-9-openjdk-amd64`

Expected result:
The program lists root directories of a runtime image (/packages, /modules) and finishes normally.

Actual result:
The program fails with the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
 at jdk.internal.jimage.BasicImageReader.slice(
 at jdk.internal.jimage.BasicImageReader.intBuffer(
 at jdk.internal.jimage.BasicImageReader.<init>(
 at jdk.internal.jimage.ImageReader$SharedImageReader.<init>(
 at jdk.internal.jimage.ImageReader$
 at jdk.internal.jrtfs.JrtFileSystem.<init>(
 at jdk.internal.jrtfs.JrtFileSystemProvider.newFileSystem(
 at java.nio.file.FileSystems.newFileSystem(
 at ReadJrt.main(

Probable reason:
Classes in lib/jrt-fs.jar were compiled by Java 9 with options "-source 8"/"target 8". They should be compiled with "--release 8" option instead (or by Java 8).


ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: openjdk-9-jre-headless 9~b181-4
ProcVersionSignature: Ubuntu 4.13.0-16.19-generic 4.13.4
Uname: Linux 4.13.0-16-generic x86_64
ApportVersion: 2.20.7-0ubuntu3
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 24 20:06:01 2017
InstallationDate: Installed on 2017-09-29 (25 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170926)
SourcePackage: openjdk-9
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
trespasserw (trespasserw) wrote :
Revision history for this message
trespasserw (trespasserw) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-9 (Ubuntu):
status: New → Confirmed
Revision history for this message
In , k463 (k463) wrote :

The `jrt-fs.jar` shipped in `java-9-openjdk-headless` package is not compatible with Java 8, which is apparently necessary for some development tools that themselves run on Java 8 to be able to use the Java 9 JDK shipped in this package.

One example of this is Intellij IDEA, which means currently it's unable to use openSUSE provided Java 9 JDK as a project JDK.

A detailed explanation of the issue can be found on OpenJDK bugtracker [1] and also a test program and steps to reproduce can be found on Ubuntu bugtracker for their corresponding package [2].

The steps are:

1. zypper in java-9-openjdk-headless java-1_8_0-openjdk-headless
2. download `` from [2]
3. /usr/lib64/jvm/java-1.8.0/bin/javac
4. /usr/lib64/jvm/java-1.8.0/bin/java ReadJrt /usr/lib64/jvm/java-9/


Revision history for this message
k463 (k463) wrote :

Also relevant bug in Intellij IDEA:

Revision history for this message
In , k463 (k463) wrote :

Also relevant bug in Intellij IDEA:

Changed in opensuse:
importance: Unknown → Medium
status: Unknown → Confirmed
Changed in openjdk-9 (Debian):
status: Unknown → New
Changed in openjdk-9 (Debian):
status: New → Fix Released
Revision history for this message
In , Postadal (postadal) wrote :


Changed in opensuse:
status: Confirmed → Won't Fix
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.