Two Jython Questions

Maan M. Hamze mmhamze at pleiades.net
Thu Aug 30 21:23:50 CEST 2001


Mats
I figured out how to run things and how to set the path of classes.
However, I am still running into one problem.  I am compiling a test.py file
into test.class using jythonc and keep getting this error on running the
class file:
Exception in thread "main" java.lang.NoClassDefFoundError: Test
By the way, I discovered that it creates test.java too.
Maan

"Mats Wichmann" <mats at laplaza.org> wrote in message
news:3b8dac97.54891359 at news.laplaza.org...
> On Wed, 29 Aug 2001 15:12:08 -0500, "Maan M. Hamze"
> <mmhamze at pleiades.net> wrote:
>
> :I just got into Jython.  I installed version 2.  After trying it out, I
> :wanted to import Java classes.  But I noticed that it will not import
from
> :jar or zip files of java classes.  In other words, I had to unzip (unjar)
> :the classes into a directory where Jython can find it.
> :1.  Is there a way to make Jython import classes directly from archives
> :(zip. jar)?  Or is this not supported.
>
> The CLASSPATH must include the jar file itself, not just the directory
> it's in.  Take a look at the Jython script itself and you'll see
> that's what it does (it will be jython.bat on WIndoze, a shell script
> on UNIX/Linux).
>
> :2.  Can Jython save a py script into a java file or is the py script
> :compiled directly into a .class file?
>
> If you want to build classfiles you can do so with jythonc. That's the
> analogue to javac, except it's Python->java bytecode instead of Java->
> java bytecode.  There's no translation to java /source/.
>
> :All in all I am impressed - this program can spoil someone into not
writing
> :a code of Java ever again.
> :Thanks,
> :Maan
> :
> :
>
> Mats Wichmann
>





More information about the Python-list mailing list