如何使Eclipse在终端中运行我的程序 [英] How to make Eclipse run my program in a terminal
问题描述
有时候,Eclipse中的控制台还不够,或者我的程序必须在某种类型的终端中运行.我将如何实现呢?
Sometimes, the console in Eclipse just isn't enough, or my program has to be run in a terminal of some sort. How would I achieve this?
我正在MacBook上使用Eclipse Mars 4.5.0.
I'm using Eclipse Mars 4.5.0 on a MacBook.
修改:我知道如何从终端运行Java程序,但是我想要的是Eclipse在我按下运行按钮时自动执行此操作.
I know how to run Java programs from a terminal, but what I want is Eclipse to do this automatically when I press the run button.
推荐答案
无法让Eclipse为您完成
要手动执行:
首先,使用您的 *.java
文件转到目录.要转到目录,请使用 cd
命令.然后,运行 javac yourfile.java
.最后, java yourfile
First, go to the directory with your *.java
file. To go to the directory, use the cd
command. Then, run javac yourfile.java
. Lastly, java yourfile
这篇关于如何使Eclipse在终端中运行我的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!