Source:
<code>public static void remoteFileDownload(ILaunchConfiguration config, ILaunch launch, String localExePath, String remoteExePath, IProgressMonitor monitor) throws CoreException { boolean skipDownload = config .getAttribute( IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false); if (skipDownload) return; monitor.beginTask(Messages.RemoteRunLaunchDelegate_2, 100); try { IRemoteConnection conn = getCurrentConnection(config); IRemoteFileService fs = conn.getService(IRemoteFileService.class); IFileStore remoteFile = fs.getResource(remoteExePath); IFileSystem localfs = EFS.getLocalFileSystem(); IFileStore localFile = localfs.getStore(new Path(localExePath)); if (!localFile.fetchInfo().exists()) { return; } localFile.copy(remoteFile, EFS.OVERWRITE, monitor); Process p = remoteShellExec( config, "", "chmod", "+x " + spaceEscapify(remoteExePath), new SubProgressMonitor(monitor, 5)); try { int waitTime = <START> 1; <END> boolean exited = p.waitFor(waitTime, TimeUnit.SECONDS); if (!exited) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "Failed to change file permissions in the remote system, path: " + remoteExePath, null); throw new CoreException(status); } } catch (InterruptedException e) { } } catch (CoreException e) { abort(Messages.RemoteRunLaunchDelegate_6, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } finally { monitor.done(); } }</code><technical_language>suggest increasing waitTime a bit. a slow target, a network filesystem, happen operation takes a bit of time. wait for time wrong, slow process returns quickly successfully</technical_language>

Target:
public static void remoteFileDownload(ILaunchConfiguration config, ILaunch launch, String localExePath, String remoteExePath, IProgressMonitor monitor) throws CoreException { boolean skipDownload = config .getAttribute( IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false); if (skipDownload) return; monitor.beginTask(Messages.RemoteRunLaunchDelegate_2, 100); try { IRemoteConnection conn = getCurrentConnection(config); IRemoteFileService fs = conn.getService(IRemoteFileService.class); IFileStore remoteFile = fs.getResource(remoteExePath); IFileSystem localfs = EFS.getLocalFileSystem(); IFileStore localFile = localfs.getStore(new Path(localExePath)); if (!localFile.fetchInfo().exists()) { return; } localFile.copy(remoteFile, EFS.OVERWRITE, monitor); Process p = remoteShellExec( config, "", "chmod", "+x " + spaceEscapify(remoteExePath), new SubProgressMonitor(monitor, 5)); try { int timeOut = 10; boolean exited = p.waitFor(timeOut, TimeUnit.SECONDS); if (!exited) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "Failed to change file permissions in the remote system, path: " + remoteExePath, null); throw new CoreException(status); } } catch (InterruptedException e) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "Interrupted while changing file permissions in the remote system, path: " + remoteExePath, e); throw new CoreException(status); } } catch (CoreException e) { abort(Messages.RemoteRunLaunchDelegate_6, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); } finally { monitor.done(); } }