简体   繁体   中英

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 .

I am using Eclipse Neon, Java version 1.8. 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. 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.

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. You cannot use those keywords in Class name, variables, method name, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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