I'm rather new to both Ant and the Java 9 module system, so please bear with me. I'm working on porting an existing Ant project over to use Java 9, and with that comes the use of modules.
In particular, right now I have 2 different modules, one which requires another, as follows:
../project/foo/src/org/bar/foo/module-info.java
module org.bar.foo {
...
exports org.bar.foo
}
../project/baz/src/org/bar/baz/module-info.java
module org.bar.baz {
requires org.bar.foo
}
During a build of baz, I receive an error: module not found: org.bar.foo.
After looking at some examples, I tried to set the --module-path through a compiler arg in the build file for baz, but I've had no luck thus far. I'm not too sure how specific/general I can be in specifying the module path.
I found my problem.
The --module-path flag should point to compiled (built) modules. In the case of Ant, this is the build directory.
For source files (what my initial question was trying to do), use --module-source-path.
More info available on the module system JEP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With