Hi John,
On Fri, 31 Aug 2001, John Goerzen wrote:
> Hi,
>
> In my .py file (again compiled with jythonc to be called from java), I
> have something like this:
>
> import java
> from java.myapp.util import UtilClass
>
> I get a runtime error complaining that the "myapp" module does not
> exist. What is the proper way of doing this? (Note that all sorts of
> other things find myapp.util.UtilClass without problems.)
The difference between your import line and your last sentence confused me
a bit. Excuse the confusion, but Is the package declared as
"myapp.util.UtilClass" or "java.myapp.util.UtilClass"? If the actual
package name is myapp.util.UtilClass, then the import should be changed
to:
from myapp.util import UtilClass
If I'm just confused about the package name, and the import really right,
then try giving a Java package hint to the SystemState with
sys.add_package(packagename):
import java, sys
sys.add_package(java.myapp.util)
from java.myapp.util import UtilClass
-robert
|