From: Michael H. <mh...@al...> - 2001-07-11 09:38:36
|
Hello, I'm new to Jython and to Java, so I might be trying things that are just nonsense. But I am having trouble importing and using multiply-nested java classes using jython. The following illustrates the problem: In testlib.java: public class testlib { static public class B { static public class C { public C() { System.out.print("This must be working!\n"); } } } } In test.java: import testlib.B.C; public class test { static public void main(String[] args) { } } In test.py: #! /usr/bin/env jython import testlib import testlib.B import testlib.B.C Try to run it: $ JIKESPATH=.:$JIKESPATH jikes testlib.java test.java $ java test This must be working! $ jython test.py Traceback (innermost last): File "test.py", line 5, in ? ImportError: No module named C $ I thought this should import the C class from jython, but it doesn't seem to work. Could the problem be that it is doubly-nested (i.e., the .class file has two '$' in it)? Otherwise I've been astounded how easy it is to use Jython and Java together, and we will probably start using it on a medium-big project at work. Thanks, Michael -- Michael Haggerty mh...@al... |