Is IntelliJ IDEA project Module different concept from Java 9 Module?

前端 未结 2 2031
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-19 17:41

I never used modules in IntelliJ IDEA, but in Java 9 appeared modules ( which I also never used but wanna study now what is this)

So the question is: are there match

2条回答
  •  猫巷女王i
    2020-12-19 18:45

    It's a similar concept that appeared long before Java 9 modules. It's also not IDE specific. Build systems like Maven and Gradle also use this concept when working with the projects that consist of multiple sub-projects. In IntelliJ IDEA terminology the module is just a sub-project (In Eclipse the module is a Project and Workspace can have multiple projects).

    Java 9 modules map to IntelliJ IDEA modules and provide additional features via the module descriptor specifying:

    • the packages it explicitly makes available to other modules (all other packages in the module are implicitly unavailable to other modules)
    • the services it offers
    • the services it consumes
    • to what other modules it allows reflection

    IntelliJ IDEA already has a concept of modules for a project. Every IntelliJ IDEA module builds its own classpath. With the introduction of the new Java platform module system, IntelliJ IDEA modules had to extend their capability by supporting the Java platform's module-path if it is used instead of the classpath.

    Related links:

    • IntelliJ IDEA modules explained
    • Migrating From Eclipse to IntelliJ IDEA
    • Understanding Java 9 Modules
    • Getting Started with Java 9 Module System
    • Support for Java 9 Modules in IntelliJ IDEA

提交回复
热议问题