Question: I have a problem with my code, even though it hasn't been modified in any way. It just suddenly threw this message. As you can see on the left, that they are all in the correct package, and have correct names.  

What can I do to fix this problem?

[![enter image description here](https://i.stack.imgur.com/ySp3u.png)](https://i.stack.imgur.com/ySp3u.png)

Answer: 
[Clear](https://stackoverflow.com/questions/8689780/how-to-clear-the-cache-in-netbeans/10722287#10722287) the cache to fix it. In Windows, cache is located at:

```
C:\Users\username\AppData\Local\NetBeans\...

```

On Linux, cache is at:

```
/home/username/.cache/netbeans/...

```

After clearing the cache restart netbeans.
I had some compiled classes from a JAR which I wanted to include in my project. I created a new package, I added the complied classes in and then got this "package does not exist" error when trying to import the new package.

If you're adding compiled Java classes and getting this error, here's how I solved it:

1. Create the package
2. Add a new (empty) Java Class (.java file) to the package, using the same name as the compiled Java class.
3. At this point, you should see your broken references to "package does not exist" or to the class file you just added are fixed.
4. Delete the new .java file and NetBeans should still see the package with the newly added classes.