📜  Java.lang.ProcessBuilder类

📅  最后修改于: 2020-11-15 03:03:57             🧑  作者: Mango


介绍

java.lang.ProcessBuilder类用于创建操作系统进程。此类未同步。

类声明

以下是java.lang.ProcessBuilder类的声明-

public final class ProcessBuilder
   extends Object

类的构造函数

Sr.No. Constructor & Description
1

ProcessBuilder(List command)

This constructs a process builder with the specified operating system program and arguments.

2

ProcessBuilder(String… command)

This constructs a process builder with the specified operating system program and arguments.

类方法

Sr.No. Method & Description
1 List command()

This method returns this process builder’s operating system program and arguments.

2 ProcessBuilder command(List command)

This method sets this process builder’s operating system program and arguments.

3 ProcessBuilder command(String… command)

This method sets this process builder’s operating system program and arguments.

4 File directory()

This method returns this process builder’s working directory.

5 ProcessBuilder directory(File directory)

This method sets this process builder’s working directory.

6 Map environment()

This method returns a string map view of this process builder’s environment.

7 boolean redirectErrorStream()

This method tells whether this process builder merges standard error and standard output.

8 ProcessBuilder redirectErrorStream(boolean redirectErrorStream)

This method sets this process builder’s redirectErrorStream property.

9 Process start()

This method starts a new process using the attributes of this process builder.

方法继承

此类从以下类继承方法-

  • java.lang.Object