jigsaw vs. jsr166 CVS
Alex Buckley
alex.buckley at oracle.com
Fri Sep 11 22:49:19 UTC 2015
Hi Martin,
javac is compiling your classes (in the unnamed module) against all the
named modules in the image. One of those named modules (java.base)
contains the java.util package, so your code (in the unnamed module)
cannot also contain that package. [That's not quite true but go with it
for now.]
What you want is the -Xoverride flag -- see the "Overriding module
content" section of JEP 261. You'll have to rename 'main' to
'java.base'. Also note the open design issues around -Xoverride.
Alex
On 9/11/2015 1:51 PM, Martin Buchholz wrote:
> Jigsawers:
>
> I tried to use jigsaw EA with jsr166 CVS for the first time.
>
> On a fresh jsr166 CVS checkout (http://g.oswego.edu/dl/concurrency-interest/),
> I did:
> ~/jsr166/jigsaw $ ant -v compile -Djdk9.home="$HOME/jdk/jigsaw-b80"
>
> and got:
>
> [javac]
> /home/martin/jsr166/jigsaw/src/main/java/util/AbstractQueue.java:7:
> warning: package exists in another module: java.base
> [javac] package java.util;
>
> and then more seriously
>
> [javac]
> /home/martin/jsr166/jigsaw/src/main/java/util/AbstractQueue.java:36: error:
> cannot find symbol
> [javac] extends AbstractCollection<E>
>
> I was surprised by that -- we don't fiddle with the boot environment here.
> Is it not allowed to compile sources for which class files are in the same
> package but another module? Alternatively, does the compile time
> environment need to include all the sources for the packages being
> compiled, i.e. do I need to add sourcepath for
> jdk/src/java.base/share/classes?
>
> (Admittedly, developing jdk sources outside the jdk proper is a little bit
> unusual)
>
More information about the jigsaw-dev
mailing list