From: <bc...@wo...> - 2001-06-07 16:28:08
|
[Mike Barton] >... >Since the rules engine wants to control processing, I am trying to make >Jython classes, compiled as Java, available to handle i/o and instance >creation. >I would really like to be able to use Jython and Java classes >interchangeably, depending on where I am in development/prototyping. > >My assumptions/observations at this time, which may or may not be correct >are: > >Java code, which will be accessed from Jython MUST be compiled as part of a >package. Not really, but it is a good idea to put such java code into packages. >Jython code, compiled with jythonc into Java is accessible from >Java but not from another Jython script. Correct. Workarounds are available, but they are ugly. >While an instance of a class can be created, the methods are not >accessible. > AttributeError: abstract method getHello not implemented Wrong, but your observation of this is perhaps a consequence of the previous item. >Any corrections or rules-of-thumb would be appreciated. > >Also if there is any reference material available that describes a simple >technique for creating and using Java packages by hand, that would help. >It seems more tedious than it needs to be. I'm likely misunderstanding you on this, but to me creating a java packages consist of: - changing my CLASSPATH envvar by adding root directory. - create a new package dir (let's call it "foo") in the root dir that was added to CLASSPATH. - create my java source files inside the foo directory and add a "package foo;" to the top of all the source files. This is all due to the way java is designed. regards, finn |