This means
If the problem is #1, you need to declare a dependency on the module where the class is (remember that all of NetBeans APIs are modules, and in separate jars - so if it's the IO API, that's a module org.openide.io, if it's the Window System, that's a module org.openide.windows... and so forth).
Setting dependencies is easy - open the Properties for your project, and choose the Libraries page. (Or just get the context menu for the Libraries node under the project in the Projects window.) Click Add and a small dialog opens - just type the name of a class you need to use, and it will filter the list to find the module that provides that class - so you don't have to memorize a huge list of mappings from classes to modules.
If it's problem #2, then you are already declaring a dependency, but get full access to all classes in a module, you need to declare an implementation dependency . Be sure you really need to use the class you're trying to use, in this case - it will make your module hard to upgrade because generally it will need to be paired with the exact version of the other module's JAR that it was built with - if that module is upgraded, your module may end up being disabled.
Problem #3 may happen if you change your modules name. If some module declared yours as a friend
it will no longer recognize it.
For a nice way to resolve all module dependencies at once, to force all of the errors to be exposed simultaneously, just add the following to the command line when starting NetBeans:
-J-Dnetbeans.preresolve.classes=true
The message displayed states that when using this flag, you should not use the -J-Xverify:none flag (often specified in the IDE configuration file), so you may need to edit the .conf file to remove the -Xverify option before using the pre-resolve option.
In the 5.0 Update 1 version of the build harness and newer, you will get compiler errors rather than runtime errors if you try to use classes from non-public packages without an implementation dependency.
Applies to: NetBeans 5.x, 6.x
Platforms: all