使用java.exe执行静默模式 [英] Silent mode execution with java.exe
问题描述
我想知道是否有办法执行java.exe作为后台进程(静默模式执行)
I would like to know if there is a way to execute the "java.exe" as a background process (silent mode execution)
Ex:java -cp 。 MyClass arg1
Ex: java -cp . MyClass arg1
我想将上述语句作为后台进程运行,无需打开命令窗口
I want to run the above statement as a background process , without opening command window
推荐答案
在Windows下,使用 javaw.exe
而不是 java.exe
。请参阅此处以获取链接,相关位复制到此处:
Under Windows, use javaw.exe
instead of java.exe
. See here for link, relevant bit copied here:
javaw
命令与java <相同/ code>,但
javaw
除外,没有关联的控制台窗口。当您不希望出现命令提示符窗口时,请使用javaw
。但是,如果由于某种原因启动失败,javaw
启动器将显示一个包含错误信息的对话框。
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.
这篇关于使用java.exe执行静默模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!