Support for jrt-fs.jar in JDK 7 would be very helpful in allowing FindBugs to run under Java 9
Alan Bateman
Alan.Bateman at oracle.com
Sat Nov 15 10:18:35 UTC 2014
On 14/11/2014 16:34, Bill Pugh wrote:
> Following up on a email thread started by Dalibor Topic…
>
> In short, back porting jrt-fs.jar to work under Java 7 would be very helpful to the FindBugs project.
>
> At length:
>
> FindBugs needs access to the classifies for the standard Java libraries in order to analyze code. Right now, we access that through the file system, but that won’t be possible under jigsaw and JEP 220: Modular Run-Time Images.
>
> The JRL file system is what is recommended and needed to support FindBugs access to standard library classifies under Java 9. Having to support two different mechanisms for accessing standard library classifies would be annoying. We could move entirely over to the JRL file system. However, FindBugs is committed to running under Java 7 for a long time, at least several more years, and it would be good if FindBugs support for Java 9 were available within a year, if not sooner.
>
> So, if jrt-fs.jar ran under Java 7, we could just rewrite that section of FindBugs to use the JRL file system, and have one version of the code running for Java 7+.
If the jrt file system provider could run on JDK 7 then it would just
mean that a tool running on JDK 7 could access the class files and
resources in a JDK 9 image. So I think this would mean that FindBugs
would need to keep its existing code so that it can get to class files
in JDK 7 and JDK 8 runtime images.
As to whether it could run on JDK 7 then it could be made to work but
would require dropping the use of newer Java Language and APIs in the
implementation. It would also require a few contortions in the build as
JDK 9 uses a JDK 8 for bootstrapping (we always use a JDK N-1 as the
boot JDK). Also just to say that a one-off back-port for JDK 7 wouldn't
work as the JDK 9 image format is intended to change and evolve, hence a
build of jrt-fs.jar in JDK 9.0.0 may not work with a JDK 9.0.1. This
means that for now at least, tools have to use the jrt-fs.jar in the JDK
9 image that they want to access.
The only way that I think would be possible to avoid two mechanisms is
for future JDK 7 and JDK 8 updates to include a jrt-fs.jar that works in
the same way but makes it transparent that the classes and resources are
coming from rt.jar, resources.jar, jsse.jar etc. Even then, I would
assume that FindBugs and other important tools wanting to keep the
existing mechanism so they can work on existing JDK 7 and JDK 8 versions.
-Alan.
More information about the jigsaw-dev
mailing list