IntelliJ idea Cache and index introduction and cleanup methods

Source: Internet
Author: User

IntelliJ when idea first loads the project, the index is created, and the time it takes to create the index is proportional to the number of files in the project, and I simply emphasize the importance of the IntelliJ idea index. Here we will elaborate on the importance of indexing and caching to IntelliJ idea.

With the introduction to the icons for common file types, you have realized what the icons for the various file types under IntelliJ idea look like. One of the icons I was specifically to explain: Java class located out of the source root . We all know that the icon is that the Java class file is not Source root displayed under the folder in the directory, but there is a situation where this icon is displayed. That is: In the IntelliJ idea to create the index process, all Java classes are this icon, if you project large, it is easy to observe, a few files of the small project is not necessarily seen. So in IntelliJ idea to create the index process even if you edit the code is not compiled, and can not run, so still quietly waiting for IntelliJ idea to create an index complete.

IntelliJ idea's caches and indexes are primarily used to speed up file queries, speeding up various lookups, code hints, and so on, so the importance of the index of the IntelliJ idea is too much to nag 10,000 times. However, IntelliJ Idea's index and cache are not always well supported by IntelliJ idea, and under certain special conditions, IntelliJ idea's cache and index files can also be corrupted, such as a power outage, a forced shutdown caused by a blue screen, when you reopen IntelliJ idea, almost 80 of the possible IntelliJ idea will report a variety of inexplicable errors, even the project will not open, IntelliJ idea theme reverts to the default state. There are some even without power, blue screen, there will be strange problems, it is also possible that IntelliJ idea cache and index problems, this situation is still quite a lot. There is no need to worry too much about this kind of problem, so let's explain how to solve it.

Clear Cache and Index

IntelliJ idea has provided a junction to clear the cache and index, as shown in callout 1.

Generally recommended click Invalidate and Restart, this will be relatively clean.
But one thing to keep in mind is that where the red circle is labeled: Clearing the index and caching will cause the local history of IntelliJ idea to be lost, so if your project is not added to version control and you need a record of your project file changes, you might want to back up your Localhistory directory. Directory Address: C:\Users\ the currently logged on system user name \. Intellijidea14\system\localhistory recommends using a full-text search of the hard drive, which is more efficient.

Through the above way to clear the cache, the essence of the index is to remove the directory under the C-disk of the system corresponding file, so if you do not use the above method can also delete the entire system . When IntelliJ idea starts the project again, it re-creates the new system directory and the corresponding item cache and index.

If you encounter the index, the cache is broken so that the project will not open, it is recommended that you can delete the system directory directly, generally this will be a good solution to your problem.

IntelliJ idea Cache and index introduction and cleanup methods

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.