Java 在 eclipse 中关闭 Intellij 想法中未使用的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22527842/
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
Closing unused modules in intellij idea like in eclipse
提问by Mustafa Güven
As I know for now there is no any feature to do that in intellij idea. I dont know why but they dont support to do that, at least this is the result which I found with all my researching. Maybe some of us manage this problem with different ways. How do you work with multiple modules in intellij? How should I increase the performance while working with multiple projects?
据我所知,目前在 intellij 想法中没有任何功能可以做到这一点。我不知道为什么,但他们不支持这样做,至少这是我在所有研究中发现的结果。也许我们中的一些人用不同的方式来解决这个问题。你如何在 intellij 中使用多个模块?在处理多个项目时,我应该如何提高性能?
采纳答案by Abimaran Kugathasan
Closing unused modules in intellij idea like in eclipse?
在 eclipse 中关闭 Intellij 想法中未使用的模块?
You can make that module directory as excluded from that project.
您可以将该模块目录排除在该项目之外。
Right clicked on the directory, then goto Mark Directory As
-> then click Excluded
it
右键单击目录,然后转到Mark Directory As
-> 然后单击Excluded
它
To Add a module back, click on Project Structure
button, then goto Modules
section, then you can add them back
要重新添加模块,请单击Project Structure
按钮,然后转到Modules
部分,然后您可以重新添加它们
回答by Meo
Projects in Eclipse are Modules in IntelliJ. I do not recommend using them the same way - ie importing unrelated projects as modules into one IntelliJ project.
Eclipse 中的项目是 IntelliJ 中的模块。我不建议以同样的方式使用它们——即将不相关的项目作为模块导入到一个 IntelliJ 项目中。
Importing for example database project and application project into one is ok, or when working on one project means working on another. But when you import too many projects into one, you will have a problem with searching and "Go To File/Class" actions, and you will use too much heap space.
例如,将数据库项目和应用程序项目导入一个项目是可以的,或者在处理一个项目时意味着在处理另一个项目。但是当你将过多的项目导入到一个中时,你会遇到搜索和“转到文件/类”操作的问题,并且会使用太多的堆空间。
Generally, when you have a lot of opened projects, there are three problems
一般来说,当你打开的项目很多时,会出现三个问题
- too much used heap -> GC pauses.
- switching between them is hard
- closing and reopening a lot of projects is hard
- 太多使用的堆 -> GC 暂停。
- 在它们之间切换很难
- 关闭和重新打开很多项目很困难
To solve this, I have made Frame Switcher pluginfor easier switching between projects, and reopening closed ones. Also, when you have 32 bit Windows and have too many projects, then you need to start new IntelliJ instance, and Frame Switcher can integrate them.
为了解决这个问题,我制作了Frame Switcher 插件,以便更轻松地在项目之间切换,并重新打开关闭的项目。另外,当你有 32 位 Windows 并且有太多项目时,那么你需要启动新的 IntelliJ 实例,Frame Switcher 可以集成它们。
There is also Missing Functionality pluginwhich lets you "Close All Other Projects".
还有缺少功能插件,可让您“关闭所有其他项目”。
回答by aleung
The Offline Moduleplugin let you disable or enable modules in project without deleting.
在离线模块插件会让你禁用或启用项目模块,而不删除。
Click Disable Module
in context menu in Project View, it disables the selected modules. Disabled Modules are shown in a group and can be add back by Load Module
.
Disable Module
在项目视图的上下文菜单中单击,它会禁用选定的模块。禁用的模块显示在一个组中,可以通过 重新添加Load Module
。
回答by ilintar
Since the old "Offline Module" doesn't work, I made a plugin to utilize the mechanics of "Mark as Excluded" to quickly show/hide multiple modules.
由于旧的“离线模块”不起作用,我制作了一个插件来利用“标记为排除”的机制来快速显示/隐藏多个模块。
Link to module here: https://plugins.jetbrains.com/plugin/7803?pr=idea
回答by Eric Bonnot
In Intellij 2017.2, you can easly load/unload modules or groups of modules :
在 Intellij 2017.2 中,您可以轻松加载/卸载模块或模块组:
- Right click in the "Project" view
- Select "Load/Unload modules"
- Select modules to load/unload and click OK button
- 在“项目”视图中右键单击
- 选择“加载/卸载模块”
- 选择要加载/卸载的模块,然后单击“确定”按钮
Warning : This is an "experimental" feature
警告:这是一个“实验性”功能
Ref : jetbrains site
参考:jetbrains 网站