java.lang.System.exit()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(216)

本文整理了Java中java.lang.System.exit()方法的一些代码示例,展示了System.exit()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。System.exit()方法的具体详情如下:
包路径:java.lang.System
类名称:System
方法名:exit

System.exit介绍

[英]Causes the VM to stop running and the program to exit with the given exit status. If #runFinalizersOnExit(boolean) has been previously invoked with a true argument, then all objects will be properly garbage-collected and finalized first.
[中]导致VM停止运行,程序以给定的退出状态退出。如果#runFinalizersOnExit(boolean)以前使用true参数调用过,那么所有对象都将被正确地垃圾收集并首先完成。

代码示例

代码示例来源:origin: libgdx/libgdx

public void windowClosed (WindowEvent event) {
    System.exit(0);
    // Gdx.app.quit();
  }
});

代码示例来源:origin: libgdx/libgdx

public void windowClosed (WindowEvent event) {
    System.exit(0);
    // Gdx.app.quit();
  }
});

代码示例来源:origin: libgdx/libgdx

public void windowClosed (WindowEvent event) {
    System.exit(0);
    // Gdx.app.quit();
  }
});

代码示例来源:origin: libgdx/libgdx

public void windowClosed (WindowEvent event) {
    System.exit(0);
    // Gdx.app.quit();
  }
});

代码示例来源:origin: libgdx/libgdx

public void run () {
    System.exit(exitCode);
  }
});

代码示例来源:origin: libgdx/libgdx

public void windowClosed (WindowEvent event) {
    System.exit(0);
  }
});

代码示例来源:origin: libgdx/libgdx

public void windowClosed (WindowEvent event) {
    System.exit(0);
  }
});

代码示例来源:origin: libgdx/libgdx

public void run () {
    System.exit(exitCode);
  }
});

代码示例来源:origin: libgdx/libgdx

private void printExceptionAndExit (Exception e) {
  e.printStackTrace();
  System.exit(1);
}

代码示例来源:origin: libgdx/libgdx

private void printExceptionAndExit (Exception e) {
  e.printStackTrace();
  System.exit(1);
}

代码示例来源:origin: jenkinsci/jenkins

/** @see #remotePost */
public static void main(String[] args) {
  try {
    System.exit(run(args));
  } catch (Exception e) {
    e.printStackTrace();
    System.exit(-1);
  }
}

代码示例来源:origin: jenkinsci/jenkins

public static void main(final String[] _args) throws Exception {
  try {
    System.exit(_main(_args));
  } catch (NotTalkingToJenkinsException ex) {
    System.err.println(ex.getMessage());
    System.exit(3);
  } catch (Throwable t) {
    // if the CLI main thread die, make sure to kill the JVM.
    t.printStackTrace();
    System.exit(-1);
  }
}

代码示例来源:origin: libgdx/libgdx

@Override
  public void run () {
    stop();
    System.exit(-1);
  }
});

代码示例来源:origin: libgdx/libgdx

public static void main (String[] args) throws Exception {
    if (args.length != 2) {
      System.out.println("ETC1Compressor <input-dir> <output-dir>");
      System.exit(-1);
    }
    ETC1Compressor.process(args[0], args[1], true, false);
  }
}

代码示例来源:origin: libgdx/libgdx

@Override
  public void run () {
    stop();
    System.exit(-1);
  }
});

代码示例来源:origin: libgdx/libgdx

public static void main (String[] args) throws Exception {
    if (args.length != 2) {
      System.out.println("ETC1Compressor <input-dir> <output-dir>");
      System.exit(-1);
    }
    ETC1Compressor.process(args[0], args[1], true, false);
  }
}

代码示例来源:origin: libgdx/libgdx

@Override
  public void actionPerformed(ActionEvent e) {
    dispose();
    System.exit(0);
  }
});

代码示例来源:origin: libgdx/libgdx

private static Map<String, String> parseArgs (String[] args) {
  if (args.length % 2 != 0) {
    printHelp();
    System.exit(-1);
  }
  Map<String, String> params = new HashMap<String, String>();
  for (int i = 0; i < args.length; i += 2) {
    String param = args[i].replace("--", "");
    String value = args[i + 1];
    params.put(param, value);
  }
  return params;
}

代码示例来源:origin: libgdx/libgdx

@Override
  public void run () {
    LwjglCanvas.this.listener.pause();
    LwjglCanvas.this.listener.dispose();
    if (audio != null) audio.dispose();
    System.exit(-1);
  }
});

代码示例来源:origin: libgdx/libgdx

@Override
  public void run () {
    LwjglCanvas.this.listener.pause();
    LwjglCanvas.this.listener.dispose();
    if (audio != null) audio.dispose();
    System.exit(-1);
  }
});

相关文章