Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java小程序在初始化器错误中引发异常_Java_Html_Eclipse_Applet - Fatal编程技术网

Java小程序在初始化器错误中引发异常

Java小程序在初始化器错误中引发异常,java,html,eclipse,applet,Java,Html,Eclipse,Applet,我在HTML文件中有以下代码 <html> <title>Applet Test</title> <body> <applet archive = "TheSlot.jar" code = "slotMachine/The_Main.class" width = "300" height = "300"> </applet> </body> </html> 小程序测试 但每当我尝试运行它时,

我在HTML文件中有以下代码

<html>
<title>Applet Test</title>
<body>
<applet
archive = "TheSlot.jar"
code = "slotMachine/The_Main.class" 
width = "300" 
height = "300">
</applet>
</body>
</html>

小程序测试
但每当我尝试运行它时,java加载循环就会出现,但它从不加载,而是抛出一个
java.lang.ExceptionInInitializeError


有人能解决这个问题吗?My The_Main类扩展了Applet,它在Eclipse中运行,并且在我的桌面上作为jar文件运行。它有多个类文件,因此我需要jar文件…

当您运行它时,它将抛出相同的异常

java.lang.ExceptionInInitializerError
请检查您的代码,确保您已经初始化了导致此错误的某些内容,如下面的示例所示,这发生在此行中

num[34]=2;
它也在静态初始化器中检查

class EX
{
static
{
int num[]= {34};
num[34]=2;
  }
 static void display()
 {
 System.out.println("this is display");
 }
 }

class exception1
{

public static void main(String args[])
{
EX.display();
System.out.println("om namah sivaya");
}
}

尽管这条线有点旧: 我在自己的一个小程序上偶然发现了这个问题。他们在不同的机器上工作,但在一台机器上我得到了这个例外。 我的解决方案是修复deploment.properties文件。
也许这有时会对某些人有所帮助。

如果我们看不到任何代码和堆栈跟踪,我们将无能为力。您在该文件中修复了什么?