Eclipse - cant add jar to build path. jar is inside the lib folder of project, but not visible
Asked Answered
A

6

5

I manually copied the my sql connector jar to lib folder of my sql jdbc project. I had some old jars already in that folder and which were also easily added to build path before. Now, I forgot how i did it and i don't see that the lib folder when i try to add the jar to build path. How do it ? I want my jar to be a part of my project and not lying in some random folder.

Appertain answered 25/7, 2012 at 0:49 Comment(2)
After you copied the JAR manually did you refresh all projects in your workspace? In Project Explorer, select all projects and press F5 to refresh.Bereft
yes, that has no effect. The jar is actually in the folder but there is no way to see it or include it through eclipse.Appertain
M
3

Try to go Window > Preferences > Java > User Libraries and add new user library that point mysql connector.And then use this library to your project.But don't forget to delete your old mysql connector jar in your lib folder.Try this way.

Melba answered 25/7, 2012 at 3:52 Comment(0)
T
9

Paste the jar directly inside eclipse using the project explorer to your desired folder and then try to "Add Jar" from Build Path->Configure Build Path->Libraries.

Toluidine answered 9/10, 2014 at 19:43 Comment(2)
Useful. Key is using the Project Explorer in Eclipse IDE (instead of Windows Explorer) to copy and paste the JAR, so it appears in the JAR Selection when you click Add JARs...Yama
This is far easier than the accepted answer, and this one works.Purple
M
3

Try to go Window > Preferences > Java > User Libraries and add new user library that point mysql connector.And then use this library to your project.But don't forget to delete your old mysql connector jar in your lib folder.Try this way.

Melba answered 25/7, 2012 at 3:52 Comment(0)
P
0

Select the project, and from its pop-up menu, select Properties. In the Properties dialog,


select the Java Build Path page.

Click the Libraries tab.

You can now either add a JAR file which is contained in your workspace or which is somewhere else:

to add a JAR file which is inside your workspace click the Add JARs button

to add an external JAR file click the Add External JARs button

In the dialog that appears, select the JAR file that you want to add. Note that you can add multiple JARs at once.

Pluvious answered 25/7, 2012 at 1:10 Comment(2)
That is where i have a problem. When I click add Jar, a menu appears which shows all my projects. I select my project and see bin, src etc, but no lib folder from where i can include the file.Appertain
you can't find the lib folder? you can mkdir in the navigation view.<br>or copy the jar in that project,<br> Remember: you have to refresh the navigation view. the project file Tree.<br> Eclipse is not such so difficult, you may ask someone besides you,hehePluvious
A
0

You can remove the old jars which relates to sql connector jar, then add the jar you requeired into the build path.If your project is web project, you can bring the jar into the folder named lib under the WEB-INF.If your project is java project , you can make a folder named lib, then take some jars into it.

Approachable answered 25/7, 2012 at 1:12 Comment(0)
G
0

Maybe you can try Command + Shift + . keys to see hidden folders on Mac

Gallman answered 31/8, 2022 at 12:36 Comment(0)
K
-2

Did this get solved - I have exactly the same issue. I had 3 libs in project/src/lib, removed 2 of them but now want to reinstate them. I can still see the jar I didn't remove in the build path dialog but no matter what I do I can't reinstate the other two as the lib folder doesn't show.

Kozak answered 5/6, 2013 at 8:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.