On 23/03/2016 14:15, Russell Gold wrote:
Here are my assumptions, which you can correct.

1. A jar or classes directory placed on a class path are treated as part of the 
unnamed module
Yes

2. A jar containing a module-info file is treated as a module when placed on a 
module path, and restricts access to non-exported packages
It also declares what it depends on and maybe services that it uses/provides.

Also a JAR file on the module path without a module-info.class is treated as an automatic module.


3. A jmod file is only usable on the module path.
JMOD files are unlikely to be seen by most developers. They are not an executable format. They are mostly for link-time when creating a custom run-time image.



If a class directory or a jar function as modules when placed on the class 
path, what is the point of a separate module path? And even in that case, 
doesn’t it make sense to treat a class directory as part of the unnamed module 
in general? That makes this problem go away completely. It doesn’t provide 
access to third parties, as code would not be distributed as loose classes.

You would loose the benefits of the module path and I assume couldn't distinguish automatic modules from regular JAR files. In general I would think this would be just confusing and I don't know what problem it would solve.

-Alan

Reply via email to