Trying to build jdk.base

Alan Bateman Alan.Bateman at oracle.com
Wed Apr 25 08:24:30 PDT 2012


On 25/04/2012 15:30, Magnus Ihse Bursie wrote:
>
> The reason for this is that modules.config contains:
>
> module base {
> //...
>     include sun.misc.*;
>     exclude sun.misc.FIFOQueueEnumerator,
>             sun.misc.LIFOQueueEnumerator,
>             sun.misc.GC,
> //...
> }
>
> but the libjava.so library is part of jdk.base; and it includes 
> sun/misc/GC.c (which is the file that, naturally, includes 
> sun_misc_GC.h). This creates a discrepancy between Java and native 
> code contained in the module. My gut feeling is that sun.misc.GC 
> should not be excluded from jdk.base.
In Jigsaw today then packages can be split between modules. As part of 
configuration then these modules that are strongly connected are brought 
together into the same context and will use the same class loader at 
runtime. So for now at least then you will run into a couple of issues 
like this at build time. If you look at modules.pkginfo (in 
$OUTPUTDIR/moduleinfo/classlist) then you see the complete list where we 
have this issue.

On sun.misc then ideally we would purge it of unused classes and move 
classes such as the above to somewhere else (see 6852936 for some 
examples of unused classes). However there is a compatibility concern 
because there is a lot of existing applications that use sun.misc 
directly. We've had warnings in the javadoc since JDK1.0 to tell folks 
not use sun.* APIs directly but it is regularly ignored. Clearly when 
they run with modules then they won't be able to use sun.* APIs but when 
running with a classpath (aka legacy mode) when developers and customers 
will expect their existing applications to just work.

So is this a major issue for your build work? For now you could remove 
the exclude so that all of sun.misc is in the base module but that would 
be a short term band aid until we figure out what to do with sun.misc.

-Alan



More information about the jigsaw-dev mailing list