From: Uncle R. <ro...@ro...> - 2001-03-18 21:43:05
|
I'm trying to have my Java code execute existing Jython code. When I compile the code using javac, I get a compiler = error that says it doesn't recognize the class PythonInterpreter (see = <=3D=3D=3D). CLASSPATH: has the JDK, the jython.jar, my Jython application jar PATH: has the JVM import org.python.util.PythonInterpreter; import org.python.core.*; import SomeJavaClass; public class MyJavaClass { public void SomeMethod (void) { PythonInterpreter interp =3D new PythonInterpreter(); // = <=3D=3D=3D=3D=3D=3D=3D=3D compiler error SomeJavaClass javaVar =3D null; // java statements, handled in Python interp.exec("import MyJythonModule"); =20 interp.exec("javaVar =3D MyJythonModule.someMethod()"); javaVar =3D (SomeJavaClass)interp.get("javaVar", = SomeJavaClass); } // end SomeMethod } // end class MyJavaClass Any ideas would be appreciated. Ron ron...@ne... (W) ro...@ro... (H) |