Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse - deploying external jars - how to?

 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Lomboz (based on 3.1 Eclipse). Things are ok to a certain extent. But I do need help with adding external jars to my web application
deployment.

I did create some JSP's/Servlets/Beans and things are working. However, I have a dependency on some external jars - log4j stuff. I changed the Project properties and added the jars 'Add External JARs' in the "Java Build Path ->Libraries". Then selected them in "Order And Export" tab.

But they are not deployed with the application (or so I think).
I see the WEB-INF/lib dir, in Eclipse, is empty.

Due to this missing libs, my beans throw an NoClassDefFoundException.

Any help is greatly appreciated.
TIA.

- m
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34384
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhav,
For ejb and web projects, the build path is only used at compile time. You need to specify them in the "java jar dependencies" for the jars to be available at runtime. The Java Jar Dependencies is available in the project properties (just like the build path.)
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw that option and selected it but, it doesn't list any jars that I can select. The list is empty. I also see a message (error?) 'Not an enterprise project?' something like that.

So I am not sure how to select the jars in this option.
Thanks.

- m
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, for now I manually copied the jars (three actually) into the WEB-INF/lib folder under the WebContent and brought up the Lomboz browser again. It seems to go further now. Please ignore this thread.

Thanks.

- m
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic