----- Mail original ----- > De: "Jonathan Gibbons" <jonathan.gibb...@oracle.com> > À: jigsaw-dev@openjdk.java.net > Envoyé: Mercredi 2 Novembre 2016 16:15:38 > Objet: Re: javac --module-source-path and --patch-module do not work together
> Remi, > > Your command line is questionable for putting output/modules on both -d > and --module-path. You don't need it on --module-path. When compiling > modules, javac will automatically look in the output directory for > classes for the module(s) being compiled. You're right i would not have to use --module-path if i was able to compile several modules at once (using --module-source-path). I use it here, because i compile the different modules with different calls to javac (in the right order because luckily there is no cycle in my example). > > Does your module source path contain source code for java.base? If so, > it will only use that definition of java.base, and not anything in the > paths given with --patch-module. I agree that if there is a folder java.base in the module-source-path, it should be used but this is not the case. Here, i want to add files to an existing modules (java.base) and those files are in output/classes not in src. > > -- Jon Rémi > > > On 11/2/16 7:14 AM, Remi Forax wrote: >> Hi Jon, hi all, >> >> When i try to compile a module with --module-source-path that uses a patched >> class (with --patch-module), >> it fails. >> >> With: >> javac --module-source-path src \ >> -d output/modules/ \ >> --patch-module java.base=output/classes \ >> --module-path output/modules \ >> $(find src/org.hibernate.jpa/ -name "*.java") >> >> it seems that javac tries to find the source of the patched module (here >> java.base) in the module-source-path, >> so it get this error >> >> error: cannot find module: java.base >> 1 error >> >> I believe this is a bug. >> >> Step to reproduce it: >> git clone g...@github.com:forax/access-broker.git >> and uncomment the lines that uses --module-source-path and --patch-module >> java.base=output/classes in the build.sh. >> >> regards, > > Rémi