简体   繁体   English

Eclipse Java应用程序刚刚终止

[英]Eclipse Java application just terminates

I have run this application yesterday and went back to work on it more today and when I try to run it, the terminal acts like it's loading and then it just says Terminated . 昨天我已经运行了该应用程序,今天又回去做更多的工作,当我尝试运行它时,终端的行为就像是正在加载,然后只是说Terminated

I am using Eclipse Neon, Java version 1.8. 我正在使用Java版本1.8的Eclipse Neon。 The only thing that has changed is that I installed Comodo firewall, but to ensure this wasn't the cause, I disabled all protection and have the same result. 唯一发生变化的是我安装了Comodo防火墙,但是为了确保不是这个原因,我禁用了所有保护并得到了相同的结果。 I'm the only one working on this project so nobody else has added anything that would cause a crash, there is no error message or exception anyway. 我是从事此项目的唯一人员,因此没有人添加任何可能导致崩溃的内容,无论如何都没有错误消息或异常。

I've right clicked on the main class, Run as ->Java Application and no luck. 我右键单击主类, Run as ->Java Application ,没有运气。

package default_package;
import java.io.File;
import java.io.IOException;

import javax.swing.JOptionPane;

import org.apache.log4j.Logger;

public class main
{
  public main() {}

  public static void main(String[] args) throws Exception
  {

    final Logger logger = Logger.getLogger(main.class);
    logger.info("Application starting");
    if (isFirstRun()) {
        logger.info("Preparing for first run");
        if (setupSumFile()) {
            JOptionPane.showMessageDialog(null,"An unknown error has occured setting up the application for first time use");
            logger.error("Unknown error in main");
            return;
        }
    }
    window w = new window();
  }
  private static boolean isFirstRun() {
      return !(new File("sums.info").exists());
  }
  private static boolean setupSumFile() throws Exception {
      File sumFile = new File("sums.info");
      if(!sumFile.exists()) {
          sumFile.createNewFile();
      }
      return isFirstRun();
  }
}

Not even the logger message about the application is getting run. 甚至没有有关该应用程序的记录器消息正在运行。

Edit: Under a suggestion, I tried to run the application in debug mode. 编辑:根据建议,我试图在调试模式下运行该应用程序。 While nothing happened and the program instantly terminated, I was able to recieve this error: 虽然什么也没发生,并且程序立即终止,但是我能够收到此错误:

Cannot connect to VM: Socket operation on nonsocket: configureBlocking

Please learn about the keywords of the Java. 请了解Java的关键字。 You cannot use those keywords in Class name, variables, method name, etc. 您不能在类名称,变量,方法名称等中使用这些关键字。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM