java.lang.Runtime

来源:互联网 发布:网络环境异常怎么修复 编辑:程序博客网 时间:2024/05/20 19:49

每一个java程序都有Runtime类的单一实例,这个实例允许程序和程序运行的环境交互。当前的运行环境可通过getRuntime方法获得。

一个程序不能创建这个类的自己的实例。

void addShutdownHook(Thread hook)
          Registers a new virtual-machine shutdown hook.

int availableProcessors()
          Returns the number of processors available to the Java virtual machine.

Process exec(String command)
          Executes the specified string command in a separate process.

Process exec(String[] cmdarray)
          Executes the specified command and arguments in a separate process.

Process exec(String[] cmdarray, String[] envp)
          Executes the specified command and arguments in a separate process with the specified environment.

Process exec(String[] cmdarray, String[] envp, File dir)
          Executes the specified command and arguments in a separate process with the specified environment and working directory.

Process exec(String command, String[] envp)
          Executes the specified string command in a separate process with the specified environment.

Process exec(String command, String[] envp, File dir)
          Executes the specified string command in a separate process with the specified environment and working directory.

原创粉丝点击