I had several compiled classes from the JAR that I wanted to include in my project. I created a new package, added the corresponding classes to it, and received this error "package does not exist" when trying to import a new package.
If you add compiled Java classes and get this error, here is how I solved it:
Create package
Add a new (empty) Java class (.java file) to the package using the same name as the compiled Java class.
At this point, you should see that your broken links to the "package does not exist" or to the class file that you just added are fixed.
Delete the new .java file and NetBeans should still see the package with the newly added classes.
source share