Saturday, June 2, 2012

cleaning netbeans cache

Sometimes working with netbease can be frustrating. Netbeans by default enables cache and does not update the cache (physical files) after moths of use.
so it is good that you clean up the netbeans logs every now and then.
E.g :  You have a deep structure of your code such as Interfaces , multiple implementations of these interfaces and dense use of these interfaces and after few months you decide to change the signature of one of the methods in interface. You change the signature in interface & implementations but then while trying to use these new signature from someother class , compiler won't recognize the new signature.
or secondly you may have a public class with multiple methods & changing the method signature doesn't get recognized in other objects. This is when you should think of cleaning the netbeans cache.

here is what you can do tpo stop pulling your hair .........

Deleting netbeans cache on windows environment

incase of windows 7 you might have to run the windows explorer or command as an administrator. below command shows to move the cache files to different directory incase you mess up something and want to revert back your changes.

C:\Documents and Settings\dnimse\.netbeans\6.5\var\cache>move .\index C:\work\netbeans-tricks

setting up the cache to false

\etc\netbeans.conf

set below value while running/starting netbeans

-J-Dcnd.cache.file.state=false -J-Dcnd.apt.cache.entry=false