How to make Eclipse run my program in a terminal

馋奶兔 提交于 2019-12-25 14:00:39

问题


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?

I'm using Eclipse Mars 4.5.0 on a MacBook.

Edit: 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.


回答1:


Making Eclipse do it for you isn't possible

To do it manually:

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



来源:https://stackoverflow.com/questions/34140373/how-to-make-eclipse-run-my-program-in-a-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!