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
- In NetBeans, create a new project or open an existing project in which you want to add the JAR file.
- Then click on the menu Run > Set Project Configuration > Customize.
- The Project Properties window will open.
- In the project properties window, click on the Libraries node at the left Categories pane.
- 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.
After this, you would be able to run your Java program with the support of external JAR files.