Clear your cache in NetBeans
There’s a problem I’ve run into in NetBeans once or twice where NetBeans places red underlines signalling compile errors in your projects, but the project actually builds and runs fine. It’s very irritating, and I’m not sure what causes it, but from what I’ve been able to find online it’s caused by a corrupted cache (the editor view thinks the file cannot be compiled due to some stale information). To fix this, execute the following command in the terminal
rm -rf /path/to/netbeans/6.8/var/cache/
(replacing 6.8 with the version of Netbeans you’re running)
Categories: NetBeans, Uncategorized
cache, netbeans, workaround
The path/to/part can be tricky. It’s probably ~/.netbeans
Once again had to clear my cache when my JUnit tests started being unable to find the classes being tested..
i am using netbeans7.0 & i m not getting any var folder in netbeans 7.0. Even cache is also not there
This article concerns NetBeans 6.9. Not sure the directory structure for NetBeans 7
It’s the same folder but version 7.0 …
On windows -> C:\Documents and Settings\(user)\.netbeans\7.0\var
if you’re on WindowsXP it’s something like :
C:\Documents and Settings\username\.netbeans\7.0\var\cache
This seems to work for me:
find . -name “*.java” -exec touch {} \;
Interesting. Not sure why touching the files would fix the problem… but glad it does
hey guys on windows vista or 7. is located at
C:\Users\ChiperOrtiz\.netbeans\6.9\var
I can verify that this fixed my problem on Linux with Netbeans 7.0.1. My home directory had a “.netbeans/7.0/var/cache” folder. I closed Netbeans, erased the cache directory, and reopened Netbeans. It rescanned all my projects and everything worked correctly from there.
Thanks!
are we suppose to erase the cache directory comletely
Yes, do a rm -rf.
Nick
should i delete the index folder
Delete everything in that folder. If index is in the folder, then yes delete it
Nick
These questions were not sufficiently answered:
“Should i delete the index folder”
“are we supposed to erase the cache directory completely”
Same questions, just worded weakly – what they appear to want to know is – are we supposed to delete the contents of the “cache” folder _AND_ the “cache” folder itself. This was the first query i also had.
The answer is, yes, you may delete the folder named “cache”, though i suspect this has little impact apart from a routine check of existing namespaces to ensure the folder is recreated.
This also fixed my problem with Netbeans suddenly not knowing any of my Class/Function/Method names and parameters when “CTRL-SPACE” is pressed, so thank you to all who posted!
i have a problem about stuck at running project. so i found this forum. but then this is already 3 years old. and i am using 8.1 netbeans now. for those people who are directed here and looking for the cache folder on windows 7. it is located at C:\Users\(User account name)\AppData\Local\Netbeans\Cache. hope this one help.