Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: classpath & too many jars

Reply
Thread Tools

Re: classpath & too many jars

 
 
John C. Bollinger
Guest
Posts: n/a
 
      07-22-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
Wendy S
Guest
Posts: n/a
 
      07-22-2003
"VisionSet" <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JARs containing JARs alan@engrm.com Java 5 05-19-2005 04:55 PM
exec jars w/dependent jars Ike Java 6 09-24-2004 06:03 PM
Re: classpath & too many jars Jon Skeet Java 1 07-22-2003 04:06 PM
Re: classpath & too many jars Joseph Millar Java 0 07-22-2003 03:32 PM
Re: classpath & too many jars Wendy S Java 1 07-22-2003 02:57 PM



Advertisments