Requires, Exports, and Provides

Paul Benedict pbenedict at
Wed Nov 25 22:48:42 UTC 2015

Dear EG members, are you still refining syntax? If so, I would like you to
consider making the keywords a bit more explicit regarding "requires",
"exports", and "provides/uses" by adding "module", "package", and "class"

Personally, I find the explicitness to be much more instantly readable.

module java.sql {
    requires module java.logging;
    requires module java.xml;
    exports package java.sql;
    exports package javax.sql;
    exports package javax.transaction.xa;
    provides class java.sql.Driver with com.mysql.jdbc.Driver;

module java.base {
    exports package to
        module java.corba,
        module java.logging,
        module java.sql,
        module java.sql.rowset,
        module jdk.scripting.nashorn;

I also think you could replace "with" with "for" if you flip the ordering:
provides class com.mysql.jdbc.Driver for java.sql.Driver;


More information about the jpms-spec-comments mailing list