繁体   English   中英

IntelliJ IDEA 启动时如何防止打开最后一个项目?

[英]How to prevent open last projects when IntelliJ IDEA starts?

默认情况下,IntelliJ IDEA 在启动时会打开最后一个项目。

如何在不打开上一个项目的情况下启动 IntelliJ?

IntelliJ 14、15、16:

Settings -> Appearance & Behaviour -> System Settings -> Reopen last project on startup

之前:

Settings -> General -> Startup/shutdown -> Reopen last project on startup.

如果出于任何原因您需要在不使用 UI 的情况下更改此设置(例如,如果 IDEA 在打开您的项目时挂起),您可以在例如

/.IntelliJIdea10/config/options/ide.general.xml

该文件的位置记录在http://devnet.jetbrains.net/docs/DOC-181 中

您需要更改(或添加)的具体设置是

<application>
  <component name="GeneralSettings">
    <option name="reopenLastProject" value="false" />
  </component>
</application>

苹果电脑

在最新版本的 IntelliJ 中,此文件在 Mac 上的位置为

~/Library/Preferences/IntelliJIdea2018.2/options/ide.general.xml

设置库

如果您启用了设置存储库,则可以在此处找到它:

~/.IntelliJIdea${idea_version}/config/settingsRepository/repository/ide.general.xml

最快的方法是

ctrl+shift+a (windows)

cmd+shift+a (mac)

然后只需输入

在启动时重新打开最后一个项目

在此处输入图片说明

对于 Mac 10.9(小牛队)上的 Intellij 13,它也位于 ~/Library/Preferences/IntelliJIdea13/options/ide.general.xml。 (我没有足够的声誉来投票支持尼古拉斯的回答)。

在 Mac 上,该文件位于~/Library/Preferences/IntelliJIdea12/options/ide.general.xml

然后将重新打开reopenLastProject选项设置为false

IntelliJ 2016.x 现在将此信息保存在自己的文件中。 在带 OSX 的 MacBook Pro 上:

~/Library/Preferences/IntelliJIdea2016.2/options/recentProjects.xml

如果 IntelliJ 在启动时挂起,请强制退出应用程序,然后将此文件重命名为“recentProjects.xml.bak”。

重新启动后,您将看到用于创建或打开项目的选项屏幕。

注意:实际路径可能会因您安装的 IntelliJ 版本而异,例如。

IntelliJIdea2016.1/ IntelliJIdea2016.2/ IntelliJIdea2016.3/

我使用以下路径在 VI 中打开了这个文件:

~/Library/preferences/IdeaIC13/options/ide.general.xml

并更改了此值:

<option name="reopenLastProject" value="true" />

<option name="reopenLastProject" value="false" />

只需勾选复选框:

Settings -> General -> Reopen last project on startup

这是想法 10。

在 IntelliJ 14 中,它是:

设置 -> 外观和行为 -> 系统设置 -> 启动/关闭 -> 在启动时重新打开上一个项目

您可以按 CTL+ALT+S 调出设置窗口。

Intellij IdeaAndroid Studio

从菜单转到:

File > Settings >Appearence & Behavior > System Settings

禁用该选项:

Reopen last project on startup

图像描述简介

WINDOWS ,路径是:

C:\\Users\\[USERNAME]\\.IntelliJIdea[VERSION]\\config\\options\\ide.general.xml

然后将reopenLastProject一个项目设置为false ,即:

<application> <component name="GeneralSettings"> <option name="reopenLastProject" value="false" /> </component> </application>


PS:如果该选项不存在,您可能必须创建该选项。

对于新的 IntelliJ 版本 [如 2020.3.2 ...]

在此处输入图片说明

对于最新版本的 Android Studio IDE

只需按照以下步骤操作

文件 > 设置 > 系统设置 > 单击重新打开最后一个项目复选框 > 应用或确定

要通过 IntelliJ IDEA 2019.1 社区版中的配置文件管理此设置,请前往~/Library/Preferences/IdeaIC2019.1/options/以使用 Patrick Wilkes 的回答和 ide.general.xml 编辑。

如果您只是尝试启动 IntelliJ 一次而不打开任何以前的项目(例如,由于 IntelliJ 与特定项目崩溃),您可以dontReopenProjects使用dontReopenProjects选项。

例子:

C:\dev\ide\IntelliJ IDEA Community Edition 2020.2\bin\idea64.exe dontReopenProjects

来源(感谢 mikebridge 在对此答案的评论中指出): https ://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#arguments

注意:还有很多其他有用的命令行选项,例如noSplashdisableNonBundledPlugins

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM