Re: classpath & too many jars

Discussion in 'Java' started by John C. Bollinger, Jul 22, 2003.

  1. VisionSet wrote:
    > I think I can get 2000 characters on the classpath but I easily exceed this
    > with all the jars req'd for struts, jstl, hibernate, jdbc etc etc
    > First I tried unzipping everything and putting everything in just 1 (or a
    > few) jar. But this doesn't make updating versions easy, and is a big hassle
    > anyway.
    > Then I hear of the extension mechanism.
    > Surely if I put everything in there then, when I distribute my app, those
    > packages will no longer be available? It is obviously not the case with a
    > webapp where I can distribute the JRE also. Or does the EM do special
    > magic?
    > What other options do I have?

    It depends on what you are trying to do. If you are developing a webapp
    then one of your options is to place all the required jars in
    WEB-INF/lib -- then you don't have to explicitly specify them in the
    classpath at all. Application servers also typically have directories
    in which you can place jars that should be accessible to all webapps;
    for general things like struts, etc. that might be a better choice than
    using the JRE's extension directory. You always have the option of
    writing a custom ClassLoader.

    All in all, it seems like you have mostly a packaging problem. Some
    approach this sort of issue by doing exactly as you first described, and
    putting all the required classes in one jar. That doesn't make updating
    easy for end-users, but gives you some control over the versions in use
    (convenient if an update to one of the third-party packages could break
    your app). Others require that users install the third-party packages
    themselves, oftentimes in a prescribed way. Still others take the
    ClassLoader route. Which you should choose depends on your specific needs.

    John Bollinger
    John C. Bollinger, Jul 22, 2003
    1. Advertisements

  2. Wendy S

    Wendy S Guest

    "VisionSet" <> wrote:

    > Unit Testing ?!

    JUnit tests work fine from Ant with an enormous list of .jar files listed in
    the classpath within the build.xml file.

    If you're building a webapp, Ant will save you a lot of time in building,
    testing and deploying. I wouldn't want to begin to do this at the command
    line, although it's certainly possible.

    Wendy in Chandler, AZ
    Wendy S, Jul 22, 2003
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wendy S

    Re: classpath & too many jars

    Wendy S, Jul 22, 2003, in forum: Java
    Wendy S
    Jul 22, 2003
  2. Joseph Millar

    Re: classpath & too many jars

    Joseph Millar, Jul 22, 2003, in forum: Java
    Joseph Millar
    Jul 22, 2003
  3. Jon Skeet

    Re: classpath & too many jars

    Jon Skeet, Jul 22, 2003, in forum: Java
    Jul 22, 2003
  4. Ike
    Andrew Thompson
    Sep 24, 2004
  5. Replies: