I am using Eclipse Neon, and I would like to execute system commands on a shell/terminal, inside Eclipse.

In particular, I will need to open the system shell using the path of the current project folder on which I'm working in Eclipse.

5

Best Answer


In some Eclipse packages, like STS or Eclipse for JEE Developers, the Terminal is already installed in your IDE. If not, you can install the TM Terminal from the Eclipse */release update site, as you can see in the image below.

enter image description here

To open the command prompt (shell or terminal) using the path of a project directory inside Eclipse, you just need to select the folder, and press Ctrl+Alt+T, or right-click and select Show In Local Terminal > Terminal.

Then, the terminal will open in a new view inside Eclipse.

enter image description here

The Eclipse IDE which I am working there is no Terminal is there. So I needed to add the plug in like this and it works fine when you try clicking Alt+Ctrl+T

Click on Help in Eclipse-->Eclipse Marketplace--> in Find box (Search terminal and Enter)--> You will see TM Terminal 4.0 Version and just install it.

You may need to restart afterwards

And finally you will be able to get the Terminal when you will type

Alt+Ctrl+T on Console.

If you don't have the TM Terminal plugin installed, you could use external run configurations.

Click on the arrow near run button with the toolbox and add a new external run configuration.external run configurations

Here, you can enter the path of your program(if you want to run commands, it will be C:\Windows\System32\cmd.exe (or the path to PowerShell on windows and /bin/bash (or similar if you use another shell) on linux.select cmd

In this dialog, you can also specify running directory of the application(the current project in your case)

After that, you can save this configuration and start it using the external run configuration menu(run button with toolbox)

Go to Window > show view > Other.
A dialog will show up, type Terminal in the search field, select Terminal and click open.
enter image description here
A new empty view will show up in Eclipse.
On the top right corner of the view there is a button Labeled "open a Terminal".
enter image description here
Click on it, a dialog will show up

enter image description here

click OK and there you go, you got a Terminal.enter image description here

Click on Run Cofiguration--> arguments --> Program Arguments (write any number of String) -->click on run