macos 如何清除 IntelliJ 项目索引?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1727922/
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-10-21 06:32:27  来源:igfitidea点击:

How to clear the IntelliJ project index?

macosintellij-idea

提问by Arne Evertsson

I've run into trouble that makes me suspect there is a bad index file that needs to be cleared. The symptoms are:

我遇到了麻烦,让我怀疑存在需要清除的错误索引文件。症状是:

  • Cmd+N will only find a subset of classes in the project
  • Trying to run JUnit test on a package won't find the test classes in that package.
  • Cmd+N 只会在项目中找到一个类的子集
  • 尝试在包上运行 JUnit 测试不会在该包中找到测试类。

Before suspecting a bad index I reinstalled IntelliJ 8.1.3, then I removed and re-checked out the source code. It didn't help. Only after checking out the code into a different folder did IntelliJ start working correctly again, but only for the new project folder. The old project folder is still infected.

在怀疑索引错误之前,我重新安装了 IntelliJ 8.1.3,然后删除并重新检查了源代码。它没有帮助。只有在将代码检出到不同的文件夹后,IntelliJ 才能再次正常工作,但仅限于新的项目文件夹。旧的项目文件夹仍然受到感染

So where is that index and how do I clear it?

那么该索引在哪里,我该如何清除它?

回答by CrazyCoder

File | Invalidate Caches, restart. Or manually delete the following folders:

档案 | 使缓存无效,重新启动。或手动删除以下文件夹:

Linux/Windows:

Linux/Windows:

  • USER_HOME/.IntelliJIdeaXX/system
  • USER_HOME/.IntelliJIdea XX/系统

Mac:

马克

  • ~/Library/Caches/IntelliJIDEAXX
  • 〜/图书馆/缓存/ IntelliJIDEAXX

(where XXis your IDEA version).

XX您的 IDEA 版本在哪里)。

See the FAQfor more details and folder locations of the other IntelliJ IDEA platform based products.

有关其他基于 IntelliJ IDEA 平台的产品的更多详细信息和文件夹位置,请参阅常见问题解答

回答by Rajan Twanabashu

For mac you can just hover over the project in recent project list, and click fn + del. that's all.

对于 Mac,您只需将鼠标悬停在最近项目列表中的项目上,然后单击 fn + del。就这样。

回答by cletus

This happens to me occasionally. Under your home directory (~ on Linux/Unix, C:\Users\LoginName under Vista/Win7, C:\Documents and Settings... under XP) you will find a directory called .IntelijIdea8x. You will want to close down IntelliJ and delete a couple of key directories, most probably:

这偶尔会发生在我身上。在您的主目录下(Linux/Unix 上的 ~,Vista/Win7 下的 C:\Users\LoginName,XP 下的 C:\Documents and Settings...),您将找到一个名为 .IntelijIdea8x 的目录。您需要关闭 IntelliJ 并删除几个关键目录,最有可能的是:

  • system/caches
  • possibly system/js_caches;
  • possibly system/jsp_caches (although probably not in this case).
  • 系统/缓存
  • 可能是 system/js_caches;
  • 可能是 system/jsp_caches(虽然在这种情况下可能不是)。

Restart it and that should fix it.

重新启动它,应该可以解决它。