error: package … does not exist in NetBeans

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

  1. In the NetBeans Project view right-click the Libraries folder
  2. In the drop down menu select Add JAR/Folder
  3. Select all the JAR files you want to add to the library, not just the folder,
  4. Click the Open button.

Join the Conversation

4 Comments

Leave a comment

Your email address will not be published. Required fields are marked *