public class Callpy extends Applet{
String text="ghq is a student!"; public void paint(Graphics g){ g.drawString(text,20,20);} }报错问题使用appletviewer运行,报错如下:java.lang.ClassFormatError: Incompatible magic value 171731060 in class file Callpyat java.lang.ClassLoader.defineClass1(Native Method)at java.lang.ClassLoader.defineClass(ClassLoader.java:800)at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:217)at java.lang.ClassLoader.loadClass(ClassLoader.java:425)at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:152)at java.lang.ClassLoader.loadClass(ClassLoader.java:358)at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:625)at sun.applet.AppletPanel.createApplet(AppletPanel.java:795)at sun.applet.AppletPanel.runLoader(AppletPanel.java:724)at sun.applet.AppletPanel.run(AppletPanel.java:380)at java.lang.Thread.run(Thread.java:745)
查也查不清楚问题,后来发现/tmp/VMwareDnD/65a3bf59/Callpy.class 下也有这样一个类,可能有问题 改了个名字,结果就能运行了,真是无语。。 参考http://www.c