Especially obvious since it is clearly stated in Jess in Action. Need to re-read it!

On Jul 22, 2006, at 4:35 PM, mdean77 wrote:

Very clear, thanks. Seems obvious in retrospect that Jess would use the JVM classpath (not in Eclipse, but I do understand the problems there.)

On Jul 22, 2006, at 3:18 PM, friedman_hill ernest j wrote:

I think mdean77 wrote:
I am not trying to be dense, and you have been very helpful...
My question is aimed at trying to understand why Jess knows from
where to import Java classes on a given computer.   That is,
I could write Java objects in any number of locations or programs on
a given computer. If I then come along and write, in some completely
different directory location, a standalone Jess file, but I try to
import Java objects that may exist anywhere on my machine, how does
Jess find them?

Every JVM has one or more instance of classes that extend
java.lang.ClassLoader. The purpose of a ClassLoader is to take the
name of a class as a String, find and load the corresponding *.class
file, and return an instance of java.lang.Class.

In Eclipse, there are roughly 87 zillion classloaders in existence at
any one time: one for each plugin, plus a system-wide one, plus G_d
knows how many others. Each one knows how to find classes in one
particular place. That's why some special configuration is
sometimes needed to make sure Jess can use the appropriate ClassLoader
to find the right classes, which is what we've been working through.

But for a more typical Java application, there's effectively just one
classloader, and it knows how to find classes according to either (1)
the places listed in the CLASSPATH environment variable, or (2) the
places given using the -cp Java command-line switch, or (3), in the
absence of either of these, in the current directory. In such an
application, that ClassLoader is easily available, and Jess uses it
directly. Therefore, Jess can load any class that the JVM itself can
load, according to CLASSPATH or -cp.

Make sense? There's no more magic to it than that. In an ordinary
application -- i.e., an application not built on a framework like
Eclipse that goes out of its way to make this impossible -- if a
program has access to a class, then Jess does too.

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify owner-jess- [EMAIL PROTECTED]
--------------------------------------------------------------------

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify owner-jess- [EMAIL PROTECTED]
--------------------------------------------------------------------

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to