Adding jar file to lib using eclipse

I'm trying out hibernate and I keep getting a: NoClassDefFoundError.

I believe I need to get the required hibernate (dom4j.jar, cglib.jar, commons-collections.jar, commons-logging.jar, ehcache.jar, log4j.jar) jar files into the WEB-INF/lib directory for them to be included in my project context classpath.

Using eclipse, I thought the hibernate jar files would be included in the context classpath.

Is this assumtion correct, and if so, how can I add the required jars and/or libraries into WEB-INF/lib directory using eclipse?

Thanks for any help.
deltaechoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
just copy them into that directory in your project
0
objectsCommented:
If you need them to build, then also add them to your build path
0
deltaechoAuthor Commented:
I need them to build, so the best way to do that is to add them to the "preferences->java->build path->user libraries?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

objectsCommented:
right click on the prject and select configure build path
and add the required jars
0
NoOodiCommented:
Right click on the project folder --> Build Path --> Configure Bulid Path... --> Add External JARS
0
Mayank SAssociate Director - Product EngineeringCommented:
Eclipse class-path and the system class-path is different. While building, you need to add them as shown above because you want to build them through Eclipse. While running the application, if you don't use Eclipse, then you will need them in your server's class-path (either in WEB-INF\lib or the common\lib folder of the server).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deltaechoAuthor Commented:
Yeah, there's the rub.  I have the hibernate core libraries and the advanced support libraries under the libraries tab to add to the build path.  The default output folder is WEB-INF/classes.  I change that to WEB-INF/lib and the message at the top is "Cannot nest...WEB-INF/lib".
0
Mayank SAssociate Director - Product EngineeringCommented:
>> The default output folder is WEB-INF/classes.  I change that to WEB-INF/lib

Let the default output folder remain as it is. Copy the additional JARs to the lib folder for running.
0
deltaechoAuthor Commented:
That at least moved me onto a new problem.  Thanks for your help.
0
objectsCommented:
Isn't that what I suggested doing originally?
0
Mayank SAssociate Director - Product EngineeringCommented:
Hmmm. Needs to be analyzed.
0
Mayank SAssociate Director - Product EngineeringCommented:
Notified Venabili to assess.
0
deltaechoAuthor Commented:
It's always better to get an explanation of what's going on along with the correct answer.  mayankeagle did a great job of explaining the process as opposed to objects who had one liners.  If you want to split the points, that's fine, but more complete answers are always more appreciated!
0
VenabiliCommented:
You can always make uneven split (20-30 for example)
0
deltaechoAuthor Commented:
Can you open this question back up so I can do that?
0
deltaechoAuthor Commented:
Excellent work mayankeagle!
0
objectsCommented:
thanks mate :)
0
Mayank SAssociate Director - Product EngineeringCommented:
No worries :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.