Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Java 9 and modularity

 
Ranch Hand
Posts: 102
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to use Java 9, my understanding is java doesn't prevent one from doing away with using modules
is that a correct statement?
 
Greenhorn
Posts: 17
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Java 9+, the module system is always in play and there's nothing you can do about it. That is most obvious when you try to compile code that imports a class from an internal API (e.g. from a sun.* package) on such a version - it will fail due to strong encapsulation of (JDK) modules (unless you add JPMS-specific command line arguments).

But: You don't have to create modules at all. As long as you place your code and your dependencies on the class path, they all end up in the so-called unnamed module and there will be no encapsulation between them, the module system will not check presence of dependencies, split packages are ok, and so on and so forth. As the JDK team put it, "the chaos of the class path" lives on inside the unnamed module. But that doesn't mean the module system is not active - it is, just not within your code.
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic