If your Java source code imports packages, you have to add the JAR files containing them to the Library.
When you try to compile your Java application in NetBeans, and you get the error message:
error: package … does not exist
- In the NetBeans Project view right-click the Libraries folder
- In the drop down menu select Add JAR/Folder
- Select all the JAR files you want to add to the library, not just the folder,
- Click the Open button.