是否可以在Java中创建命令提示符? [英] Is it possible to make command prompt in Java?

查看:126
本文介绍了是否可以在Java中创建命令提示符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想知道是否可以在Java中创建命令提示符。
我的朋友要求制作它,我想知道它是否可能。如果有可能,有人可以建议我一些api或什么?谢谢。

I would just like to know whether it is possible to make a command prompt in Java. My friend asked to make it, I wanted to know if it was possible or not. If it is possible, can someone suggest me some api or something? Thank you.

编辑:我想使它类似于Windows命令提示符

I want to make it similar to windows command prompt

编辑2:我会喜欢制作一个SWING GUI应用程序并在其中添加命令提示符。

EDIT 2: I would like to make a SWING GUI application and put a command prompt inside of it.

推荐答案

您可以使用Process在Java中运行命令API。您还可以获取输出并写入输入到已运行的流程。有关详细信息,请参阅本教程

You can run commands in Java using the Process API. You can also get the output and write input to the runned process. For more info, see this tutorial.

但是如果你想用Java制作一个终端模拟器(比如Linux中的那些),我建议看看 JCTerm JTA

But if you want to make a terminal emulator (such as those in Linux) in Java,
I recommend having a look at JCTerm or JTA.

这篇关于是否可以在Java中创建命令提示符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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