Home » Java » How to Add External JAR File in NetBeans Project?

How to Add External JAR File in NetBeans Project?

These days I am trying my hands on Java, and I created a simple Java program using NetBeans IDE to connect to the Oracle Database. To do this, I need to add the ojdbc7.jar file to my project so that at runtime Java program can access it. Below I am mentioning the steps to add external JAR file in the NetBeans project.

Adding External JAR file in NetBeans Project

  1. In NetBeans, create a new project or open an existing project in which you want to add the JAR file.
  2. Then click on the menu Run > Set Project Configuration > Customize.
  3. The Project Properties window will open.
  4. In the project properties window, click on the Libraries node at the left Categories pane.
  5. Then on the right side, click on the Run tab and then click on the Add JAR/Folder button and browse the external JAR files you want to add, as shown in the below image. Then click on the OK button.

Project Configuration

After this, you would be able to run your Java program with the support of external JAR files.

See also: