Reputation: 39992
I need to send commands to the windows CMD or linux terminal from an Eclipse wizard. Not my first choice but I'm not the architect so just following orders. Is there a way to send a command to the CMD and/or Terminal?
For an example, we'll be doing:
mvn -create $projectName $location
where we replace the project name and location with values from the wizard. Yes I know there is an mvn plug-in, I have a specific reason for needing this (or at least my boss does). Suggestions?
Also, I do NOT need a plug-in that allows you to type to the CMD or Terminal from Eclipse. Thanks
Upvotes: 2
Views: 798
Reputation: 12718
If you do this in a separate thread - e.g. a new Job
- then you can just use the existing java.lang.Runtime.exec(...)
mechanism...
If you want to follow the execution as well in a console within IDE, then have a look at org.eclipse.debug.internal.ui.views.console.ProcessConsole
or one of its super-classes.
Upvotes: 3