我想知道是否有办法执行“
java.exe”作为后台进程(静默模式执行)
例如:java -cp. MyClass arg1
我想以上述语句作为后台进程,不用打开命令窗口
解决方法
在
Windows下,使用javaw.exe而不是java.exe.请参阅
here链接,相关位复制在这里:
The
javaw
command is identical tojava
,except that withjavaw
there is no associated console window. Usejavaw
when you don’t want a command prompt window to appear. Thejavaw
launcher will,however,display a dialog Box with error information if a launch fails for some reason.