[m-rev.] for review: add missing prereqs for .class files

Julien Fischer jfischer at opturion.com
Fri Sep 26 16:02:08 AEST 2025


On Fri, 26 Sept 2025 at 15:53, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
>
>
>
> On Fri, 26 Sep 2025 15:16:26 +1000, Julien Fischer <jfischer at opturion.com> wrote:
> > There's an overview of Java compilation here:
> > <https://openjdk.org/groups/compiler/doc/compilation-overview/index.html>
>
> Thanks for that.
>
> The relevant part of the introduction seems to be this:
>
>   Finally, the syntax trees created by the parser are analyzed
>   and translated into class files. During the course of the analysis,
>   references to additional classes may be found. The compiler will
>   check the source and class path for these classes; if they are found
>   on the source path, those files will be compiled as well, although
>   they will not be subject to annotation processing.
>
> Without this diff, it seems javac was not finding the "additional classes",
> which is why it failed. With this diff, this failure does not happen.
> That's fine. What is not fine is that this says those additional classes
> will also be compiled, which seems to me to be crazy. It means that
> if you have a utility module (call it module_u), and a bunch of modules
> (module_a, module_b, ... module_t) that all use module_u, then there
> can be no separate compilation for any module except module_u,
> because every time you compile e.g. module_c, module_u gets
> compiled as well.

In Java-land incremental compilation is offloaded to external build
tools like maven or gradle; the Java compiler itself is fairly primitive
in that department.

...

> I wonder whether Oracle intentionally obfuscates their public documentation
> in order to sell more consulting services :-(

As I understand it, these days the Oracle version of Java is
essentially a snapshot
of openjdk + a bunch of licensing.

Julien.


More information about the reviews mailing list