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
Sun Nov 23 20:09:49 UTC 2014
On 23/11/2014 19:29, Andrey Loskutov wrote:
> :
> Unfortunately FindBugs would not be able to use your jigsaw-jrtfs project
> because FindBugs must be able to run on Java 7 and your project requires Java
> 8 (at least I saw few lambda's here and there).
You probably know this already but the dependency on JDK 8 is in the
file system provider implementation (packaged as jrt-fs.jar in the
target VM), it's not an API dependency and jrt-fs.jar is not required in
the build environment.
Clearly with jrt-fs.jar compiled for >= JDK 8 then it would require
running findbugs with -javahome set to a JDK 8 to access a JDK 9 image
but that might not be too bad.
> :
>
> Implementing both based on your code and ignoring Java 7 constraint is
> probably not a big deal. What we additionally need is to change our command
> line arguments (or the parser [2,3]). Today user can specify JDK libraries to
> be analyzed by FindBugs together with the application code - of course this
> code assumes that those files are in jar/zip format. We need to change the
> logic here to and to allow user specify extra JDK 9 ".jimage" files (don't
> make much sense for me) or to provide extra argument with JDK system root to
> use during analysis.
It would be best to avoid asking users to specify file paths to .jimage
files as there is no guarantee that the file names or locations of these
binary changes will not change over time.
Providing the ability to specify the JDK home sounds better. One thing
that might help is to look at the "release" file in the top-level
directory of the image. The "release" file was introduced a few major
releases back specifically to allow tools introspect a JDK/JRE image to
see what version it is without actually running anything in the image.
It also has a property value with the list of modules in the image
(which might be helpful too).
> :
>
> Looking on the changes required to make FindBugs/Eclipse happy with new Java 9
> structure (modules/jfs) I would like to ask here: why couldn't we extract all
> JDK 9 classes on installation from "jfs" to the "legacy" lib/rt.jar location?
As a short term fix to keep existing versions of tools working with JDK
9 then this might be okay. The jimage tool in the bin directory has an
extract option for this.
-Alan
More information about the jigsaw-dev
mailing list