I am trying to run my c/c++ .exe
from eclipse RCP
(Java API).
Code:
package com.jkt.rcp.texteditor.handlers;
import java.io.IOException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
//import com.jkt.runner.utils.Test;
public class RecordHandler extends AbstractHandler {
private RecordingThread recordingThread;
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
System.out.println("inside RecordHandler...");
recordingThread = new RecordingThread();
recordingThread.start();
return null;
}
}
And code of RecordingThread.java
is:
package com.jkt.rcp.texteditor.handlers;
import java.io.IOException;
public class RecordingThread extends Thread {
private String file = "C:\\workspace\\JProAcceptanceBot\\Record.exe";
public void run() {
System.out.println("inside Run()...");
try {
Process proc = Runtime.getRuntime().exec(file);
} catch (IOException e) {
System.out.println("IOException:"+e);
e.printStackTrace();
}
}
}
Actually RecordHandler.java
executes after clicking a eclipse RCP
button.
But as soon as I click button, c/c++ exe
doesn't respond and my Java program stops responding.
Otherwise if I run this exe
inside my eclipse, it runs fine.
This c/c++ exe
has been made by using Eclipse CDT and Cygwin.
Please have a look into code and suggest ?