On Jul 3, 2005, at 1:42 AM, Jacek Laskowski wrote:
Especially with Dain's runtime trick to find the
jar in the classpath and use it to discover where the software was
installed (e.g. to find openejb.home).
Hehe, I've read about it lately - http://blogs.sun.com/roller/page/
dreamwords?entry=how_to_get_the_current. Didn't know that Dain did
a similar thing.
This guys's trick only works if your code was loaded using a property
extended secure class loaders. The good news is that almost everyone
uses a subclass of URLClassLoader which propertly extends secure
class loader, but not every project does this. This stuff is quite
hard to get correct, and I'm pretty sure the way I do this could be
improved.
-dain