Java IntelliJ 中的 Eclipse 工作区等效吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30463738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 09:41:15  来源:igfitidea点击:

Eclipse workspace equivalent in IntelliJ?

javaintellij-ideaprojects-and-solutions

提问by Dims

It is said in IntelliJ IDEA Q&A for Eclipse Usersthat Eclipse Workspace is equivalent to "project" in IntelliJterms, while Eclipse's project is equivalent to IntelliJ's module.

这是在说IntelliJ IDEA的Q&A为Eclipse用户了Eclipse工作区是等同于“工程”IntelliJ方面,而Eclipse的项目等同于的IntelliJ的模块。

But after I created a project untitledand then created module untitled2I got the following picture

但是在我创建了一个项目untitled然后创建了模块之后untitled2我得到了下面的图片

enter image description here

在此处输入图片说明

I would think untitledis a project and untitled2is a module, but both has srcsubfolders and listed in

我认为untitled是一个项目并且untitled2是一个模块,但两者都有src子文件夹并列在

enter image description here

在此处输入图片说明

so, both are modules of different level. Is this correct?

所以,两者都是不同级别的模块。这样对吗?

Is it possible to create module untitled3at the same level as untitled?

是否可以创建untitled3与 相同级别的模块untitled

How to create several modules of the same level without topmost one?

如何在没有最顶层的情况下创建多个相同级别的模块?

采纳答案by Darek Kay

If you want to simulate the Eclipse workflow, you should create an empty project (~ workspace) first:

如果要模拟 Eclipse 工作流,应先创建一个空项目(~工作区):

New Project > Empty Project

New Project > Empty Project

Now you can create separate modules (~ projects) to be shown exactly like you want:

现在您可以创建单独的模块(〜项目)以完全按照您的需要显示:

enter image description here

在此处输入图片说明

You could also select untitled2, press F6(Refactor > Move) and move it one level up in your directory. While creating untitled3you can specify the folder for your module (use IdeaProjectsinstead of untitled).

您也可以选择untitled2,按F6( Refactor > Move) 并将其在您的目录中向上移动一级。在创建时,untitled3您可以为您的模块指定文件夹(使用IdeaProjects而不是untitled)。

回答by hitz

The workspace equivalent term refers to Project Window in intellij. It will consists of modules which are equivalent of individual projects in Eclipse.

工作区等效术语是指 intellij 中的项目窗口。它将由相当于 Eclipse 中单个项目的模块组成。

EDIT:You can right click on untitledmodule and go to Open Module Settings. And select Modulesin project settings. With +sign you can choose to create new module. This should create new module on same level as untitled

编辑:您可以右键单击untitled模块并转到Open Module Settings. 并Modules在项目设置中选择。有了+标志,您可以选择创建新模块。这应该创建与相同级别的新模块untitled

回答by Andrew Tobilko

All the information you need is here. JetBrains has a wonderful guide called "Working with modules".

您需要的所有信息都在这里。JetBrains 有一个很棒的指南,叫做“使用模块”。

回答by Meo

Modules can be created on any level and any location, regardless the project location. You can safely remove the "parent" module.

无论项目位置如何,都可以在任何级别和任何位置创建模块。您可以安全地删除“父”模块。