Windows Command is not executed correctly [message #1767730] |
Mon, 10 July 2017 12:07 |
Shoumo Das Messages: 2 Registered: June 2017 |
Junior Member |
|
|
I wrote below code
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
boolean result = MessageDialog.openQuestion(window.getShell(), "Spring Bean Integration Test", "Do you want to continute?");
String accurev_home = System.getenv("ACCUREV_HOME");
if (result){
// OK Button selected do something
try {
Runtime.getRuntime().exec("cmd /c start cmd.exe /K \"cd "+accurev_home+"\\SRN_SF && gradlew : testSpring\"");
MessageDialog.openConfirm(window.getShell(), "Test", "cmd /c start cmd.exe /K \"cd "+accurev_home+"\\SRN_SF && gradlew : testSpring\"");
} catch (IOException ex) {
ex.printStackTrace();
}
} else {
// Cancel Button selected do something
System.out.println(result);
}
return null;
}
It is working fine when run as eclipse application. But it is not working when I export the project as Deployable Plug-ins and fragments .Command prompt is opening with with default eclipse root path. Please help me out.
[Updated on: Mon, 10 July 2017 12:08] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02610 seconds