简体   繁体   English

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

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

By default IntelliJ IDEA opens the last project when starting.默认情况下,IntelliJ IDEA 在启动时会打开最后一个项目。

How to start IntelliJ without opening last project?如何在不打开上一个项目的情况下启动 IntelliJ?

IntelliJ 14, 15, 16: IntelliJ 14、15、16:

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

Previously:之前:

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

If for any reason you need to change this setting without using the UI (for example if IDEA is hanging when it opens your project), you can find the setting in eg如果出于任何原因您需要在不使用 UI 的情况下更改此设置(例如,如果 IDEA 在打开您的项目时挂起),您可以在例如

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

The location of the file is documented in http://devnet.jetbrains.net/docs/DOC-181该文件的位置记录在http://devnet.jetbrains.net/docs/DOC-181 中

The specific setting you need to change (or add) is您需要更改(或添加)的具体设置是

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

Mac苹果电脑

In the latest version of IntelliJ, the location of this file on a Mac is在最新版本的 IntelliJ 中,此文件在 Mac 上的位置为

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

Settings Repository设置库

If you have the settings repository enabled, then it can be found here:如果您启用了设置存储库,则可以在此处找到它:

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

The fastest way is to最快的方法是

ctrl+shift+a (windows) ctrl+shift+a (windows)

cmd+shift+a (mac) cmd+shift+a (mac)

and then just type然后只需输入

reopen last project on startup在启动时重新打开最后一个项目

在此处输入图片说明

For Intellij 13 on Mac 10.9 (Mavericks), it is located at ~/Library/Preferences/IntelliJIdea13/options/ide.general.xml as well.对于 Mac 10.9(小牛队)上的 Intellij 13,它也位于 ~/Library/Preferences/IntelliJIdea13/options/ide.general.xml。 ( I don't have enough reputation to vote up Nicholas' answer ). (我没有足够的声誉来投票支持尼古拉斯的回答)。

On the Mac the file is located at ~/Library/Preferences/IntelliJIdea12/options/ide.general.xml在 Mac 上,该文件位于~/Library/Preferences/IntelliJIdea12/options/ide.general.xml

And then set the reopenLastProject option to false .然后将重新打开reopenLastProject选项设置为false

IntelliJ 2016.x keeps this information in its own file now. IntelliJ 2016.x 现在将此信息保存在自己的文件中。 On my MacBook Pro w/OSX:在带 OSX 的 MacBook Pro 上:

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

If IntelliJ hangs on startup, force quit the app then rename this file to something like "recentProjects.xml.bak."如果 IntelliJ 在启动时挂起,请强制退出应用程序,然后将此文件重命名为“recentProjects.xml.bak”。

Upon restart you'll get the option screen for creating or opening a project.重新启动后,您将看到用于创建或打开项目的选项屏幕。

Note: the actual path may vary depending upon which version of IntelliJ you have installed eg.注意:实际路径可能会因您安装的 IntelliJ 版本而异,例如。

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

I opened this file in VI using this path:我使用以下路径在 VI 中打开了这个文件:

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

and changed this value:并更改了此值:

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

to

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

Just tick the checkbox:只需勾选复选框:

Settings -> General -> Reopen last project on startup

This is for idea 10.这是想法 10。

In IntelliJ 14 it is:在 IntelliJ 14 中,它是:

Settings -> Appearance & Behaviour -> System Settings -> Startup/Shutdown -> Reopen last project on startup设置 -> 外观和行为 -> 系统设置 -> 启动/关闭 -> 在启动时重新打开上一个项目

You can bring the settings window by pressing CTL+ALT+S.您可以按 CTL+ALT+S 调出设置窗口。

Intellij Idea or Android Studio : Intellij IdeaAndroid Studio

From the menu go to :从菜单转到:

File > Settings >Appearence & Behavior > System Settings . File > Settings >Appearence & Behavior > System Settings

disable the option:禁用该选项:

Reopen last project on startup

图像描述简介

On WINDOWS , the path is:WINDOWS ,路径是:

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

Then set reopenLastProject to false , ie:然后将reopenLastProject一个项目设置为false ,即:

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


PS: You may have to create the option if it doesn't exist. PS:如果该选项不存在,您可能必须创建该选项。

For new IntelliJ versions [like 2020.3.2 ...]对于新的 IntelliJ 版本 [如 2020.3.2 ...]

在此处输入图片说明

For The latest version of Android Studio IDE对于最新版本的 Android Studio IDE

Just follow this steps只需按照以下步骤操作

File > Settings > System Settings > click Reopen the last project Check-box > Apply or Okay文件 > 设置 > 系统设置 > 单击重新打开最后一个项目复选框 > 应用或确定

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

If you're just trying to start up IntelliJ once without opening any previous projects (eg due to IntelliJ crashing with a specific project), you can use the dontReopenProjects option from the command line.如果您只是尝试启动 IntelliJ 一次而不打开任何以前的项目(例如,由于 IntelliJ 与特定项目崩溃),您可以dontReopenProjects使用dontReopenProjects选项。

Example:例子:

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

Source (credit to mikebridge for pointing it out in a comment on this answer ): https://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#arguments来源(感谢 mikebridge 在对此答案的评论中指出): https ://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#arguments

Note: There are also a bunch of other useful command line options as well, eg noSplash and disableNonBundledPlugins .注意:还有很多其他有用的命令行选项,例如noSplashdisableNonBundledPlugins

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

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