NetBeans Quick Tip #18: What to Do when Things Go Wrong?



It can happen that things go wrong. For instance, you install that very cool plug-in somebody has developed and oops, the IDE starts to do strange things. Or your hardrive capacity goes to zero because you're downloading latest DVD image of your favorite Linux distribution and oops, NetBeans has nowhere to write. Or you open many versions of JDK sources and your userdir starts to grow due to the cache.

What to do now? A typical reaction of a Windows user is to reinstall the application. Well, you can reinstall NetBeans for 1000 times but it won't help, simply because the corrupted or overgrown data is in your userdir. The userdir contains both your configuration, installed extra modules, caches and other application specific data, similarly as applications like Firefox do it.

Instead of reinstalling NetBeans shutdown the IDE, delete the userdir and re-run NetBeans. It will recreate the userdir. You need to choose the correct userdir according to your version (e.g. 4.1, 5.0 or dev for development version). Note that you may lose your configuration, so it pays of to backup the userdir just in case, but except for installed modules I can't think of other important data, other than it may take a while to reconfigure the IDE. If you want to delete just the cache (because parsing went crazy or became slower), delete only /var/cache.

Some people might think that sharing this kind of information is not good - basicly I'm admiting that things can go wrong. Well, this happens, no hardware or software is perfect, so my take is that if we can help our users recover from the issues, let's help them. Majority of them won't have to deal with this anyway, but it can help those who will have to.
Comments:

One part of the userdir that's usually worth saving is the library definitions. Save the contents of {userdir}/config/org-netbeans-api-project-libraries somewhere, and restore it after netbeans has created a fresh version of your userdir. That way you won't have to go thru the painful process of redefining all your libraries. Regards, David

Posted by David Coldrick on leden 04, 2006 at 07:34 odp. CET #

Right, libraries configuration is useful to be backed up.

Posted by Roumen on leden 05, 2006 at 01:43 dop. CET #

Having to reconfigure the whole IDE is quite a pain and many would find this unacceptable, myself included. One thing would be to back up the whole user dir before trying anything new. Sorry to refer back to Eclipse, which offers to save the current configuration. Such thing is useful. However, I believe it's easier to understand what such a feature would do in NetBeans's case.

Posted by Lucian Pintilie on leden 05, 2006 at 02:10 dop. CET #

Hmm this sounds as a useful feature to me. I might write a plug-in for that if I have time...

Posted by Roumen on leden 05, 2006 at 02:19 dop. CET #

The solution is allready there, "import settings" when older userdir are detected while starting up the first time. The problem with it is that it only searches the profile. There is no way to point it to a userdir located elsewhere. I'm looking forward for a plugin that does the job.

Posted by bart on leden 05, 2006 at 02:02 odp. CET #

Post a Comment:
Comments are closed for this entry.
About

Roman Strobl

Search

Archives
« duben 2014
PoÚtStČtSoNe
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today