如何在Java中创建进程 [英] How to create a process in Java

查看:340
本文介绍了如何在Java中创建进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中创建一个进程。但是在浏览了Java的API后,我仍然没有完全理解它。

I would like to create a process in my application. But after looking around and from Java's API I still don't quite get it.

基本上我想创建一个多进程应用程序。但是新进程在我的应用程序中是一个类。

Basically I want to create a multi process application. But the new process is a class in my application.

我知道有些人可能会问为什么不创建一个线程?因为该类正在调用matlab代码,所以问题和Java类是这里

I know some of you might ask why not create a thread? Because the class is calling a matlab code, the problem and the Java class is Here

有没有办法做到这一点?

Is there any way to do this?

推荐答案

只有一种方法可以用Java创建进程, Runtime.exec() - 基本上它允许你像通过命令行界面一样启动新的JVM。

There is only one way to create processes in Java, Runtime.exec() - basically it allows you to start a new JVM just as you would via the command line interface.

这篇关于如何在Java中创建进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆