Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding external .jar file in Eclipse

I'm having trouble adding a .jar file I downloaded for my Java project. This is really the first time I've used eclipse, so please bear with me and for some reason (I have no clue why), I just find it somewhat confusing.

I know that in order reference different class files you simply need to create a class library and add it to the build path. From there, all which needs to be done (unless I'm misunderstanding this for whatever reason) is use the "import" keyword to import whatever .jar, .java, or .class/.interface file necessary into the project.

I've tried that with my .jar. I have it referenced in the build path (all I did was just copy the jar to the project directory, and then use the build path option to add it externally), but when ever try to call the object "Delegator", which obviously is a part of the .jar file, it won't read.

Am I missing something here? Seriously, anyone who knows the answer to this - you're relieving a mother of a headache. And before anyone asks - yes, I've searched this one to death. I've found similar questions, but nothing which quite hit what I was looking for. Either that, or I really just lack the common sense.

like image 745
zeboidlund Avatar asked Jun 09 '11 05:06

zeboidlund


1 Answers

Right click on project->BuildPath->Libraries->Addexternaljar and then press ok and if it doesnot worked then you should go to the

Order and Export  tab
and checked the jar you have just added in your project. It will solved your problem.
like image 126
BBdev Avatar answered Oct 06 '22 05:10

BBdev