Repairing NetBeans support for Java code after a JDK reinstallation
If you accidentally uninstall the JDK that you told NetBeans (during its installation) to use and then start NetBeans you’ll find out that even if you reinstall that JDK at the same folder location NetBeans still doesn’t work OK with Java code (can’t load Java projects saying there’s a missing plugin). The trick to fix this is to go to Tools/Plugins menu and at the "Installed Plugins" page activate all plugin categories that had been deactivated by NetBeans when you had started it and it didn’t find the JDK.
This took me a while to figure out, it would be better if NetBeans was saying "missing or disabled" plugin at the project open dialog instead of just saying "missing" plugin since this makes you search for uninstalled/new plugins you might be missing and thus misleads you in debugging the issue.
*** followup: ***
I was also pointed to http://wiki.netbeans.org/TaT_TroubleShootNBStartUp by Varun Nischal (thanks), but it isn’t exactly the same issue I feel. This is my reply to Varun regarding this:
That documentation addresses the issue of editing NetBeans configuration manually to locate the JDK. My tip was that if you start NetBeans with missing the default JDK platform you had set, then it disables many plugins required for Java development and if you reinstall JDK at the same location then although NetBeans can find it the plugins are disabled and you can’t work with Java ok (was using JavaEE stuff) getting various errors. So you can go to Tools/Plugins and at the Installed plugins page enable all the plugin categories that have been disabled and then all works fine again