can't get import to work!

corsairdgr at corsairdgr at
Mon Jan 15 18:35:06 CET 2007

 I am brand new to jython/python.
 I want to use my own Java class from within a Jython script.
 In Java, I created a class called Fubar and put this in a jar file called testit.jar.
 The Fubar class is in the package and this path shows up in the
 testit.jar file. I then modified the jython.bat file (I'm using windows) to include
 the testit.jar file in the classpath. When jython starts from the command line,
 it notices testit.jar and generates some cache information.
 Next I want to use the Fubar class in a jython script. I start jython from the command line and type:
 from import Fubar
 This doesn't work. The following error is displayed:
 ImportError: No module named for
 I also try
 This gives the same error.
 I can enter import java.util.HashMap and other such imports and these work. 
 Can someone please tell me what I could be doing wrong ?
Check out the new AOL.  Most comprehensive set of free safety and security tools, free access to millions of high-quality videos from across the web, free AOL Mail and more.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list