Adding Libraries to a Dynamic Web Application in Eclipse

I am currently developing a simple web application that would apply the MVC architecture. To those new to the MVC term, it stands for Model-View-Controller. An architecture used for simple applications that separates the GUI pages (for end client), the business logic (reusable classes), and the controller (that controls the event or method call). You can easily implement this in Eclipse by creating a new Dynamic Web Application project.

Apparently, during the development process, I’ve encountered a simple yet very important problem. My Database related classes can’t locate the classes from Postgre (which is my database system). This is due to the Library from Postgre that my code is looking.

The big question now – “How will I add a library in my Dynamic Web Project?”

Well, in a simple Java Project, this is easy but for a project of this kind where your sources are placed in a separate directory scheme it is the other way around.

I found this thread and it worked:

http://dev.eclipse.org/newslists/news.eclipse.webtools/msg11326.html

The solution is quite straightforward:
- Right click on the your web project and choose PROPERTIES
- Choose the J2EE Module Dependencies
- Click on the Add External JARs… and then point on your library file (ZIP or JAR)
- Click on Apply then OK.
- Restart your Apache Tomcat

The added library should be seen under: ProjectName > Java Resources: src > Libraries > WebApp Libraries.

ARMAN

14 Comments

  1. Hmm, you can just place the needed jars into /WEB-INF/libs and they will be added to the classpath too ?

  2. eherm eherm… ^_^ sori i can’t see anything where i could just leave a message ^_^ eniway~ musta na po ? ^____^

  3. Hello Balder,

    Thanks for the info. I tried your suggestion and it worked! :D

    – arman

  4. Thanks Fiona for visiting. It’s been a while since I heard from you. Hope everything is fine with your work now. Please extend my regards to our JPCS and Baste friends.

    – arman :D

  5. @ajison
    glad I could be of help

  6. Exactly what I am searching for. What an incredible resource the web ! Thankyou !

  7. You are a live saver

    cheers

  8. oh man, i love simple guides for the uber noobs in Eclipse. <3

  9. Thank u so much. i faced this problem for a long time. Now ok la.. thanks a lot

  10. Hi,

    It worked (at least for me). Nice post.

    Iker.

  11. Hi

    I had this problem, I found this post and IT WORKED.

    thx

  12. grazie mille!!!

  13. Thanks a lot for sharing …

  14. Excelent! Saved me from pulling my hair out! Thank you!!!


Comments RSS TrackBack Identifier URI

Leave a comment

  •  

    November 2007
    M T W T F S S
    « Oct   May »
     1234
    567891011
    12131415161718
    19202122232425
    2627282930  
  • What I am currently reading?

  • “Tuldok System” has been featured by WordPress.com