java和javaw的区别

简单说来java.exe和javaw.exe功能相同。
 
区别在于:
  • javaw.exe是以窗口方式来运行Java class文件。
  • java.exe是用命令行方式来运行Java class文件。
From Sun Microsystems, Inc.

The javaw.exe command is identical to java.exe, except that with javaw.exe there is no associated console window. This implies you can't get it to display the version with -version, since there is no console to display it on. Use javaw.exe when you don't want a command prompt window to appear. The javaw.exe launcher will, however, display a dialog box with error information if a launch fails for some reason.
 
java.exe是java.exe一个无控制台窗口版本,功能和java.exe相同,不过用它运行java程序时没有关联的console输出,程序里的错误也是以对话框的方式弹出提醒的,比如抛出的异常等。
 
如果在程序的开发阶段,就用java.exe,这样可以看到错误提示。
不过,例如Eclipse这样的开发工具都默认是采用javaw.exe来进行的。




posted @ 2012-01-20 14:35  __BSD__  阅读(1017)  评论(0编辑  收藏  举报