Search code examples
javanetbeansimportautosuggest

Netbeans refuses to auto suggest known classes for imports


I just discovered that my NetBeans suddenly stops importing classes that are found in the Java API but can still import classes from my external libraries. Take a look at the image below:

NetBeans editor

As you can see, List and ArrayList are classes from the java.util package but the usual suggestions for importing them are not shown here, instead it is asking me to create class. I know that I can type import java.util.List; on the top of the code but life was better before! Please I need help thanks.


Solution

  • I had the same problem a couple minutes ago... Terrible. The same problem has been reported here:

    Bug 235712

    The solution which I've found there was sufficient - simply delete the Netbeans cache...

    In order to do this, go to Help ==> About . Then go to the directory with cache and delete all you find in the "index" catalog.

    enter image description here

    After restarting the NB, everything was cool.