A quick look at java.ext.dirs seems to indicate the intention for this is for packages with the root javax.*, which are specifically defined as extensions of J2SE. Is this really the right place to put things like third-party JAR files?

The approach I have seen is you write your own classloader that then uses a property to load classes from jar files stored in a particular directory. If I remember right, BEA's app server used to do this, quite nice.

David

Lance J. Andersen wrote:

That is a very good point. You could also use lib/ext as well and set the property java.ext.dirs property accordingly

Jeremy Boynes wrote:

Lance J. Andersen wrote:

There is also an issue on windows of a classpath size. I know i have been burnt by this before.


I think most projects of any size, commercial or open source, have moved away from using raw CLASSPATH and use custom classloading.


For example, a common technique is to have a "lib" directory where all files get added into a single classloader - not perfect especially when you may need multiple versions of a library but it works for many applications.

There are also things like the uberjar project at Codehaus for bundling things together.

--
Jeremy


Reply via email to