Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
My environment: Windows XP, JDK 1.5, Jython 2.2b
In a February 2007 Jython Monthly article, Steve Langer presented a means of
altering the class path at runtime based on a translation of some Java code
(which addressed the same problem).
I tested out the Jython approach using a jar named pop3.jar which had some
classes in a com.sun.mail.pop3 package.
Interestingly, while the approach worked from the standpoint of not
any exception, I wasn't able to import the package.
It turns out that the java.net.URLClassLoader has a method named
'getURLs' in addition to the 'addURL' method (used to add the target jar
/ load classes in the target jar). After calling the 'addURL' method
via method.invoke and then calling the 'getURLs' method via the same
technique, my target jar shows up in the result. But still, no joy in
importing the package.
I tried this with 2 other jar files and observed a similar result.
Can anyone shed any light on what is happening? And how to get to the
point where an import of the package covered by the target jar is