From: Wayne P. <wa...@mi...> - 2002-02-19 05:20:19
|
rbill wrote: > On Sun, 17 Feb 2002, Wayne Pierce wrote: > >>I haven't worked with Jython in a while, so I thought I'd build a simple >>Applet to refresh my memory. I copied the code from the web site below: >> >>from java.applet import Applet >> >>class HelloWorld(Applet): >> def paint(self, g): >> g.drawString("Hello from Jython!", 20, 30) >> >>I then used jythonc to create a .jar file and have the following in my HTML: >> >> <applet code='HelloWorld' archive='hello.jar' width=200 height=200> >> <applet> I found one problem, the file I created was 'hello.py' but the class was 'HelloWorld'. When I changed them to match the error I was getting before went away...and I got a new one. :-( > Does the browser you are using have plugin support for JDK 1.4? Without > plugins, use jdk 1.1.8 to compile applets. If this is no help, forward > the options given to jythonc and the java console output. I didn't load the applet plugin, but this time I did test it with appletviewer.exe and got the following output: java.lang.NoClassDefFoundError: org/python/core/PyProxy at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:512) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12 6) at java.net.URLClassLoader.defineClass(URLClassLoader.java:249) at java.net.URLClassLoader.access$100(URLClassLoader.java:57) at java.net.URLClassLoader$1.run(URLClassLoader.java:196) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:189) at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:309) at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:114) at java.lang.ClassLoader.loadClass(ClassLoader.java:265) at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:470) at sun.applet.AppletPanel.createApplet(AppletPanel.java:551) at sun.applet.AppletPanel.runLoader(AppletPanel.java:480) at sun.applet.AppletPanel.run(AppletPanel.java:293) at java.lang.Thread.run(Thread.java:539) When I compiled with 'jythonc -jar hello.jar hello.py' I got the following output: Warning: -jar is deprecated, use --jar processing hello Required packages: java.applet Creating adapters: Creating .java files: hello module hello extends java.applet.Applet Compiling .java to .class... Compiling with args: ['c:\\jdk\\bin\\javac', '-classpath', 'C:\\jython\\jython.j ar;;.\\jpywork;;C:\\jython\\Tools\\jythonc;C:\\Xitami\\webpages\\.;C:\\jython\\L ib;C:\\jython', '.\\jpywork\\hello.java'] 0 Note: .\jpywork\hello.java uses or overrides a deprecated API. Note: Recompile with -deprecation for details. Building archive: hello.jar Tracking java dependencies: I've tried moving the HTML file and the .jar into the jpywork directory with no luck. I'm not sure what to try next, I even tried another program from Jython_for_Java_Programmers. That program worked fine when typed interactively but didn't work when I tried to make a .jar and run it. Thanks for any help, Wayne |