From: Phil Surette <psurette@es...> - 2001-12-21 15:31:36
Here is a really good article explaining how java2 classloading
I read this a while ago, but:
In short, classes from extensions can only access
classes in the boot class path (which is usually only rt.jar).
Classes in the 'normal' classpath cannot be seen
from an extensions.
IMO, extensions are evil.
From: bckfnn@... [mailto:bckfnn@...]
Sent: Monday, November 26, 2001 11:34 AM
Subject: [Jython-users] Re: Import strange error
>| My guess is that jython.jar exists in jre/lib/ext and that is the reason
>| that jython can only load other code that also reside on the
>Yes it actually is. I put everything I need in the jre/lib/ext dir to=20
>avoid classpath problems. Is there a side effect of putting jython in=20
It seems like the classloader that is loading extentions does not itself
search the classpath.
I can't find a place in the Java documentation stating that it is the
case, but you can verify that it is by putting your Test.class in a .jar
file and copy the jar file to jre/lib/ext. I predict that the Test
program also fails then.
>I cannot see why putting the jython.jar in this=20
>directory would prevent to load classpath items physically located=20
It is the classloader that loaded the jython.jar that decides. When
running with jython.jar in my jre/liv/ext, I get see that it is an
ExtClassLoader that loaded jython.
Jython 2.1b1 on java1.4.0-beta3 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import org
>>> I get:
>>> *sys-package-mgr*: processing new jar,=3D20
>> Hmm, that output can't be from your little java program.
>Well I did not put anything else than the program. The jython.jar seems
>to be automatically loaded and processes the classpath items.
>even if the -cp option is specified the jvm goes looking into the=20
>/jre/lib/ext. This is strange but understandable...
That part is documented:
Jython-users mailing list