Since cache is a bit buggy in NetBeans 7.0 (I reported that earlier but can't find in BZ), I must delete ~/.netbeans/var quite often.
(The problem is that some packages are reported as missing, sometimes it behaves like it had old versions of classes, etc. Deleting var fixes it.)
But seems to delete Maven repositories indexes. Which then takes very long to redownload and reindex.
Could there be some menu item to dump classes cache? E.g "Tools > Dump classes cache" or "Source > ... ". Or better, fix the cache :)
Related to Bug 115670 - Ability to define cache location instead of dev/var/cache and ability to clean it
It's a duplicate, but I will leave it for devs to close to notice this :) Thx
what is it a duplicate of?
The reason I'm asking is because I too have a problem with:
(In reply to comment #0)
> (The problem is that some packages are reported as missing, sometimes it
> behaves like it had old versions of classes, etc. Deleting var fixes it.)
And I too would like to see some menu item to dump classes cache.
This is still a regular problem with Netbeans. Especially when using git
as a backend, since git will rapidly change files when switching branches
or during merges. Once Netbeans gets it's index corrupted, the only solution
is to remove the cache and restart.
It seems to me that one of the underlying bugs here is that "clean and build"
really should include cleaning the cache for all the packages and classes
referenced. If that's not possible, a simple command would surely help.
(In reply to comment #4)
> It seems to me that one of the underlying bugs here is that "clean and build"
> really should include cleaning the cache for all the packages and classes
> referenced. If that's not possible, a simple command would surely help.
This is a very good suggestion.
NetBeans needs to be able to clear the cache on a per project basis.
I have just experienced the same problem, with dev-201304242301:
Did a random file copy+refactor, and had a class with the a wromng package declaration.
Fixed the declaration, but the application as deployed to app server (JBoss AS7 in this case) always failed with the error about the wron package.
Killed all processes, "Clean And Build", scan for external changes, restart NB...
In the end, I had to manually delete (MacOS)
rm -rf /Users/XXX/Library/Caches/NetBeans/dev/index
to get it back to run.
1. of course, cache should not be stable, but it will happen eventually...
2. "Clean and Build" should definetly delete all caches. That's why I choose clean.
3. "Scan for external changes" should rebuild bad caches anyway.
4. As the last resort, a manual clear cache should be available. In Netbeans, not as Terminal command...