开发者

Use CMD or Terminal from Eclipse plug-in programmatically

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

wher开发者_如何学Goe 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜