Netbeans中ExitSecurityException异常
来源:互联网 发布:淘宝客采集软件是什么 编辑:程序博客网 时间:2024/04/28 04:01
Pitfall: Misuse of System.exit
Explanation: The System.exit method forces termination of all threads in the Java virtual machine. This is drastic. It might, for example, destroy all windows created by the interpreter without giving the user a chance to record or even read their contents.
Solution: Programs should usually terminate by stopping all non-daemon threads; in the simplest case of a command-line program, this is as easy as returning from the main method. System.exit should be reserved for a catastrophic error exit, or for cases when a program is intended for use as a utility in a command script that may depend on the program’s exit code.
Explanation: The System.exit method forces termination of all threads in the Java virtual machine. This is drastic. It might, for example, destroy all windows created by the interpreter without giving the user a chance to record or even read their contents.
Solution: Programs should usually terminate by stopping all non-daemon threads; in the simplest case of a command-line program, this is as easy as returning from the main method. System.exit should be reserved for a catastrophic error exit, or for cases when a program is intended for use as a utility in a command script that may depend on the program’s exit code.
在Netbeans中,建议以下的关闭方式代替System.exit:
org.openide.LifecycleManager.getDefault().exit()
- Netbeans中ExitSecurityException异常
- NetBeans中设置@author
- netbeans中改jre
- NetBeans中配置浏览器
- NetBeans 中开发 Yii
- netbeans中表格使用
- netbeans中按钮实现
- netbeans中快捷键
- 在NetBeans中修改模板
- Netbeans中图形界面的引用
- NetBeans中JSF应用开发
- 在netbeans中使用JUnit
- NetBeans中如何显示对话框?
- NetBeans平台中调用状态栏
- 在Netbeans中使用DataBinding
- ubuntu中netbeans乱码解决方法
- netbeans中创建applet程序
- 在NetBeans中使用JUnit
- 方法中定义的类的域可见性
- linux 挂载移动硬盘
- 《北京故事》
- Java流与文件
- java标准I/O重定向
- Netbeans中ExitSecurityException异常
- 一个内存寻址的例子
- 最真的梦?
- core文件的使用
- 重新回味一首歌 Everything Will Flow——Suede乐队
- 头文字D
- tcp/ip 越学越杂
- 0-2 go on kobe!
- Vocal学习