|
From: <bc...@wo...> - 2001-11-19 08:52:34
|
[Chris Monson] >First of all, I love Jython! I have done some amazing things with it in >the two days of experience that I have :) > >I have an application working in Jython, and I am currently trying to >get the applet to work, as well. I am using Jython 2.1a3 with JDK >1.3.1_01 from Sun. > >I did the following: > >jythonc --core --deep --jar myapplet.jar myapplet.py > >And it produced the appropriate jar file with all of the fixings, as >expected. > >However, when trying to invoke the applet with appletviewer (or in a >browser plugin), I got the following: > > java.lang.NoClassDefFoundError: org/python/compiler/JavaMaker > >I finally isolated it to this line of python code: > > from java.awt import Panel, Font, Button, Panel, Color, Label > >Notice that 'Panel' is imported twice in that list. That was causing >the problem (but the error was not very helpful at all). Once I removed >the spurious Panel import, I stopped getting that particular error. > >I am currently struggling with a different error, but the one above is >clearly (IMHO) a Jython bug, and I figured I should let you guys know. I have added a bugreport about it, but I doubt I'll bother to fix it. Jythonc does a static analysis of all the assignments going on in the python script and this analysis does not handle re-assignments to the same name. I agree that jythonc can be improved so it recognizes that Panel is obviously bound to the same value. regards, finn |