Before continuing, take a look on the image below:
Any thoughts on why I'm unable to export the same module as my declared module in the module-info.java?
P.S: The highlighted error message has nothing to do with this topic. But if you have any hint on this error, try answering this stackoverflow topic
Thx in advance!
Slight correction, you can use the exports
directive for packages and not modules. The declaration syntax is detailed in JLS7.7 as
exports PackageName [to ModuleName {, ModuleName}] ;
Other few lines of your code(consisting of exports ...
) comply with the behavior and seems to be compiling. The reason for the failure on the mentioned line is because the package projects
is empty and empty packages are not allowed to be exported by the java module system.