How to clear the cache in NetBeans
I created a project in NetBeans, and I would like to clear the NetBeans cache.
I'm running NetBeans 7.0.1 on a Windows 7 machine.
How do I do this?
Close NetBeans before deleting the cache.
NetBeans 7.2+, Windows 7
Cache is located in C:\Users\<username>\AppData\Local\NetBeans\Cache\
.
Clear the cache using the %USERPROFILE%
Windows variable:
del /s /q %USERPROFILE%\AppData\Local\NetBeans\Cache\
If it is set, you can also use the environment variable %LOCALAPPDATA%
:
del /s /q %LOCALAPPDATA%\NetBeans\Cache\
NetBeans 7.2+, Linux
Cache is at: ~/.cache/netbeans/${netbeans_version}/index/
Mac OS X
Cache is at: ~/Library/Caches/NetBeans/${netbeans_version}/
See also http://wiki.netbeans.org/FaqWhatIsUserdir.
Help Menu
On Windows, selecting the Help » About menu will display a dialog that contains the following text:
Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Java: 1.7.0_80; Java HotSpot(TM) 64-Bit Server VM 24.80-b11
Runtime: Java(TM) SE Runtime Environment 1.7.0_80-b15
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Username\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\Username\AppData\Local\NetBeans\Cache\8.0.2
Regardless of operating system, the About dialog will contain the correct path to the cache directory.
The path of the cache directory is listed in the About window (menu Help/About). Close NetBeans, then delete (or rename) the directory. NetBeans will rebuild its cache when it starts up.
Before 7.2, the cache is at C:\Users\username\.netbeans\7.0\var\cache
. Deleting this directory should clear the cache for you.
On a Mac with NetBeans 8.1,
- NetBeans → About
- Find User Directory path in the About screen
-
rm -fr 8.1
In your case the version could be different; remove the right version folder. - Reopen NetBeans
I'll just add that I have tried to resolve reference problems caused by a missing library in the cache, and deleting the cache was not enough to solve the problem.
I closed NetBeans (7.2.1), deleted the cache, then reopened NetBeans, and it regenerated the cache, but the library was still missing (checked by looking in .../Cache/7.2.1/index/archives.properties).
To resolve the problem I had to close my open projects before closing NetBeans and deleting the cache.