• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Organizing jar files into folders within lib

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My web app is starting to contain a lot of jar files, I would like to add sub directories in the lib folder for my web app. However i am unsure of how to configure the class loader for my app so it reads the sub directories.

I read this: http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

but i am unclear on how to create the entry so it is per webapp. I am also not sure on how to define the path to my lib directory so I can add the sub directories to the path.

Has anyone done this before?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. It seems like a waste of time to me. Just dump all the jars into the lib during the automated build and who cares if they're structured or not.
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:No. It seems like a waste of time to me. Just dump all the jars into the lib during the automated build and who cares if they're structured or not.



I do agree, i guess its more for my sanity. I have a habit of trying out new jars, then choosing to not use them and leaving them behind. Wouldn't want to bloat the app with jars not being used.
For now i just created a text file with a list of jars that belong to each other and what they are used for. Only thing is I have to now maintain it. I was able to at leas get rid of old jars when i created the list.
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure about Tomcat but in JBoss you can tell it in jboss-service.xml where to look for jars..

For instance:


this allows us to put jars and property files in the conf folder without affecting the war.

WP
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Schretz wrote:

Bear Bibeault wrote:No. It seems like a waste of time to me. Just dump all the jars into the lib during the automated build and who cares if they're structured or not.



I do agree, i guess its more for my sanity. I have a habit of trying out new jars, then choosing to not use them and leaving them behind. Wouldn't want to bloat the app with jars not being used.
For now i just created a text file with a list of jars that belong to each other and what they are used for. Only thing is I have to now maintain it. I was able to at leas get rid of old jars when i created the list.



So, you are having managing the jars that are the dependencies of the jars that you use?

It might help if you use maven as your build tool. In maven, you specify only the jars that you are dependent on. It automatically finds out the dependencies' dependencies and downloads them. That way, once you stop using a lib, just remove it from your build file, and it will automatically stop using it (and it's dependencies).
 
reply
    Bookmark Topic Watch Topic
  • New Topic