gpt4 book ai didi

java - 以隐藏模式运行进程

转载 作者:行者123 更新时间:2023-11-30 09:49:46 25 4
gpt4 key购买 nike

如何在 Java 中以隐藏模式(不应显示任何窗口)运行外部进程。我用谷歌搜索,发现这可以在 .NET 中使用以下代码完成:

Dim ProcessProperties As New ProcessStartInfo
ProcessProperties.FileName = "notepad"
ProcessProperties.Arguments = "myTextFile.txt"
ProcessProperties.WindowStyle = ProcessWindowStyle.Hidden
Dim myProcess As Process = Process.Start(ProcessProperties)

是否为 Java 提供了任何类似的功能?

最佳答案

javaw 是你要找的吗?

参见 here

The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.

关于java - 以隐藏模式运行进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5596631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com