IntelliJ IDEA 项目模块与 Java 9 模块的概念不同吗? [英] Is IntelliJ IDEA project Module different concept from Java 9 Module?

查看:39
本文介绍了IntelliJ IDEA 项目模块与 Java 9 模块的概念不同吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从未在 IntelliJ IDEA 中使用过模块,但在 Java 9 中出现了模块(我也从未使用过但现在想研究这是什么)

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)

那么问题是:有没有相互匹配的?或者 IDEA 模块很早就出现并且用于不同的目的?

So the question is: are there match each other? Or IDEA modules appeared long before and for different purposes?

推荐答案

这是一个类似的概念,早在 Java 9 模块之前就出现了.它也不是特定于 IDE 的.像 Maven 和 Gradle 这样的构建系统在处理由多个子项目组成的项目时也使用这个概念.在 IntelliJ IDEA 术语中,模块只是一个子项目(在 Eclipse 中,模块是一个项目,工作区可以有多个项目).

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 模块映射到 IntelliJ IDEA 模块并通过指定的模块描述符提供附加功能:

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

  • 它明确提供给其他模块的包(所有模块中的其他包对其他人隐式不可用模块)
  • 它提供的服务
  • 它使用的服务
  • 它允许反射到哪些其他模块

IntelliJ IDEA 已经有一个项目的模块概念.每一个IntelliJ IDEA 模块构建自己的类路径.随着介绍在新的 Java 平台模块系统中,IntelliJ IDEA 模块必须通过支持 Java 平台的模块路径来扩展他们的能力如果使用它而不是类路径.

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.

相关链接:

这篇关于IntelliJ IDEA 项目模块与 Java 9 模块的概念不同吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆