问题
I am getting an error intermittently when I build my Java project in Intellij.
Internal caches are corrupted or have outdated format, forcing project rebuild: java.io.FileNotFoundException: C:\target\classes\ehcache.xml (Access is denied)
I have run File->Invalidate caches. I have restarted Intellij and killed all Java processes. I eventually get it to build again but not sure what thing I try does the trick.
When I try to access the 'Target' folder, it says Access Denied.
Anyone seen this before?
回答1:
As mentioned in my comment, I received the same message, but without any access right issues involved whatsoever.
It seemed to be some kind of confusion on IDEA's end. I was able to fix this by deleting the system
directory in C:\Users\%USERNAME%\.IdeaIC13
(the path obviously depends on the IntelliJ IDEA version).
This stores all caches and indices among other things. I have to confess that I can't tell why exactly this helps, but it seems to be a rougher way to "invalidate caches" and it works. Your project history is not deleted this way, so you can practically continue working - just that all files have to be scanned again and all indices have to be rebuilt.
In any event, this was not an access rights problem at all.
回答2:
If you can't access the folder have to either change the rights for the entire hierarchy starting from your project root folder as described here, or move your project to some other directory that you are allowed to access
回答3:
For me, I just had to clean all modules (and ensure they didn't require sudo permission), and rebuild.
The File->Invalidate Caches/Restart...
did not work for me.
回答4:
Tried all the above, but none worked for me. Finally running Intellij 14 in admin mode did the trick.
回答5:
I had this exact problem, I tried all of the above solutions but none of them worked for me.
The I tried the oldest one in the book (ie rebooting my laptop) and that fixed everything!
回答6:
Similar to pdinklag's answer, I had to delete my user-level Android Studio caches to get rid of this error. However, Android Studio caches are stored in ~/.android/
.
I shut down Android Studio, then ran:
cd
rm .android/cache build-cache build-cache.lock
Then restarted Android Studio, and things worked.
来源:https://stackoverflow.com/questions/19480480/intellij-error-internal-caches-are-corrupted-or-have-outdated-format