运行java小程序时魔法值1013084704不兼容
运行hello world小程序时,我收到不兼容的魔法值1013084704错误:运行java小程序时魔法值1013084704不兼容,java,html,Java,Html,运行hello world小程序时,我收到不兼容的魔法值1013084704错误: import javax.swing.JApplet; import javax.swing.SwingUtilities; import javax.swing.JLabel; public class Screenshot extends JApplet { //Called when this applet is loaded into the browser. public void i
import javax.swing.JApplet;
import javax.swing.SwingUtilities;
import javax.swing.JLabel;
public class Screenshot extends JApplet {
//Called when this applet is loaded into the browser.
public void init() {
//Execute a job on the event-dispatching thread; creating this applet's GUI.
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
JLabel lbl = new JLabel("Hello World");
add(lbl);
}
});
} catch (Exception e) {
System.err.println("createGUI didn't complete successfully");
}
}
}
HTML代码:
<applet code="Screenshot.class" archive="<?php echo URLgenerator::getScryptURL('screenshot.jar')?>" width="100px" height="100px"></applet>
问题与在
元素中指定存档的方式有关
看看元素在到达web浏览器时的真实外观。提示:使用“视图作为源”
我预计发生的情况是存档的URL不正确,并导致服务器提供错误页面。浏览器试图将错误页面的HTML内容解释为JAR文件或类文件,并发现它没有所需的“幻数”
(尝试以十六进制查看该数字,然后将字节映射到ASCII…可能重复的。。。这与某种HTML内容是一致的。