How to Add External JAR File in NetBeans Project?

  • Java
  • 1 min read

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:

This Post Has 2 Comments

  1. P. M. Nirmal

    I searching for solution to attach hsqldb.jar to my project in NetBeans. But as per your instructions I clicked Run> Set Project configurations > Customize. I got the Project Properties window. But I couldn't find the 'Libraries' option on the left panel of the window as stated by you. I am using NetBeans 12.3 version IDE. Any solution please?

    1. Jayant

      Its because u r using Maven instead use Ant

Comments are closed.