How to Add External jar in Eclipse?

To add an external jar in Eclipse we can follow the steps given below:

There are a few ways to add the MySQL Connector JAR to an Eclipse Java project, The easiest one of the most common is:

  1. Download the MySQL Connector JAR from the official website.
  2. Go to Eclipse, and open the project where you want to add the JAR.
  3. Right-click on the project in the Project Explorer and select Build Path -> Add External Archives...
ClassNotFoundException: com.mysql.jdbc.Driver add external jar in eclipse
  1. Navigate to the location where you have downloaded the MySQL Connector JAR and select it.
  2. Click on the Apply and Close button to add the JAR to the project’s classpath.

Alternatively, you can add the jar file to the build path of your project by following these steps:

  1. Right-click on the project in the Project Explorer and select Properties.
  2. Select Java Build Path on the left side.
  3. Select the Libraries tab, Classpath, and then click on the Add External JARs button.
ClassNotFoundException: com.mysql.jdbc.Driver add external jar in eclipse project
  1. Navigate to the location where you have downloaded the MySQL Connector JAR and select it.
  2. Click on the Apply and Close button to add the JAR to the project’s classpath.

You should now be able to use the MySQL Connector classes in your project. You can verify that the jar is added to the build path by checking whether it’s listed in the Referenced Libraries folder in the project explorer. It should display an external jar as shown in the image below:

How to Add External jar in Eclipse? Add External Jar in eclipse

After following the steps given above you should be able to add an external JAR in the Eclipse project.


Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments