Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 970
Jevison7x Avatar asked Jun 13 '14 13:06

Jevison7x


People also ask

How do I Auto Import in NetBeans?

Use Ctrl + Shift + I will import all the required packages.

How do I get suggestions in NetBeans?

It is easy to enable Java hints in NetBeans. Select "Tools" from the title bar, then select "Options" from the drop-down menu. Choose the "Editor" option and then select the "Hints" tab. At this point, make sure that the "Language" drop-down is set to "Java" (other choices include PHP, JavaScript, and Ruby).


1 Answers

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.

like image 95
guitar_freak Avatar answered Sep 21 '22 02:09

guitar_freak