Two Jython Questions

Delaney, Timothy tdelaney at avaya.com
Thu Aug 30 20:31:12 EDT 2001


> From: Maan M. Hamze [mailto:mmhamze at pleiades.net]
> 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.

Sounds to me like you have the code set up like this ...

# test.py

class Test

    # some stuff

Now, Java (and Python for the most part) is case-sensistive on the
filesystem level. So, when you compile 'test.py' you end up with
'test.class'.

Then in your Java code you try to use the class 'Test'. It then searches for
a file called 'Test.class' - and doesn't find it!

Try renaming your file to 'Test.py' (note case) and try again.

Tim Delaney




More information about the Python-list mailing list