You may want to look at this:
I tested your example on Windows XP using jreload:
From: Xavier Noria [mailto:fxn@...]
Sent: Sunday, February 27, 2005 5:38 AM
Subject: Re: [Jython-users] Re: problem with jars in Windows XP (Xavier
On Feb 27, 2005, at 11:27, Armin Ehrenfels wrote:
> Sunday afternoon and low temperatures outside, a good opportunity to
> write a few emails.
Hi! It's relatively cold down here in Barcelona as well, though I bet
warmer than there :-),
> sorry for having been so terse and even made a mistake with my
> environment on Windows XP. No, what I suggested doesn't work on my
> system, either. Of course, you are right, this behaviour is not
> correct. But, I'm with Todd who mentioned setting CLASSPATH
> appropriately. This is a secure way to have all Java classes
Well, it is a secure way in the sense that the other one is buggy,
sys.path.append is as robust as setting a CLASSPATH from a formal point
of view. In that sense I'd call using CLASSPATH instead of
sys.path.append a _workaround_.
Think that you don't always know the CLASSPATH in advance and my be
interested in constructing one on the fly. For instance if you were
writing a servlet container, or an IDE as is my case. Then the
workaround is a custom class loader but the point is that with
sys.append it shouldn't be needed (speaking broadly). You are able to
modifiy the classpath _easily_ in Jython in runtime, another thing that
is a PITA to do in Java turned into a single method call in Jython.
I saw in Jython Essentials something like sys.path.append(jar) it was
being defined at the time of writing (I don't have the book here to
quote), so maybe we are using a not-yet clearly defined feature and
thus calling that "buggy" is not accurate.
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
Jython-users mailing list