Java 编译器(NetBeans)失败…发生JNI错误

Java 编译器(NetBeans)失败…发生JNI错误,java,netbeans,Java,Netbeans,我在自学java。我目前正在研究类和java。我编写了此代码,但出现了以下错误: 错误:发生JNI错误,请检查安装并重试 线程“main”C:\Users\Wiliez\AppData\Local\NetBeans\Cache\8.2\executor snippets\run.xml:53:Java返回:1中出现异常 生成失败(总时间:0秒) 我不明白为什么我不能编译。我做错了什么? 这是我的密码: public class RectArea { public static void main

我在自学java。我目前正在研究类和java。我编写了此代码,但出现了以下错误:

错误:发生JNI错误,请检查安装并重试 线程“main”C:\Users\Wiliez\AppData\Local\NetBeans\Cache\8.2\executor snippets\run.xml:53:Java返回:1中出现异常 生成失败(总时间:0秒)

我不明白为什么我不能编译。我做错了什么? 这是我的密码:

public class RectArea {
public static void main(String[]args)
{    int myArea = new areaFormula(6,8).getArea();    
   System.out.println(myArea);

}
 }

public class areaFormula {
public int legnth, width;
public areaFormula(int leg, int wid)
        {
            legnth = leg;
            width = wid;
        }
public int getArea()
{
    return legnth*width;
}

}

问题不在您的代码中为什么不能编译?我试图运行一个简单的“地狱世界”程序,但它成功运行。您的代码中有一个错误,但编译器应该通知您,而不是像这样崩溃。