hnm
hnm

Reputation: 829

Running process in hidden mode

How do I run external process in hidden mode (no windows should be visible) in Java. I googled and found that this can be done in .NET using the following code:

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

Is there any similar features provided for Java?

Upvotes: 2

Views: 3262

Answers (2)

Andy Thomas
Andy Thomas

Reputation: 86381

You can use ProcessBuilder to start the process.

If it's a Java application, you can start it with javaw to avoid a window.

Upvotes: 0

ewan.chalmers
ewan.chalmers

Reputation: 16235

Is javaw what you are looking for?

See 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.

Upvotes: 2

Related Questions