Package org.eclipse.debug.core

# Interface ExecFactory

public interface ExecFactory
A `ExecFactory` can be used to control how Eclipse forks a new `Process`.

Since:
  3.23

## Method Summary

Modifier and Type
Method
Description
`Optional<Process>`
`exec(String[] cmdLine, Optional<File> workingDirectory, Optional<Map<String,String>> environment, boolean mergeOutput)`
Executes the given command with the provided working directory and environment

## Method Details

### exec

Optional<Process> exec(String[] cmdLine, Optional<File> workingDirectory, Optional<Map<String,String>> environment, boolean mergeOutput) throws CoreException
Executes the given command with the provided working directory and environment

Parameters:
  `cmdLine` - the commandline to execute
  `workingDirectory` - an optional working directory to be used otherwise the process factory must use its default
  `environment` - the environment to use, if empty the process factory must use its defaults
  `mergeOutput` - `true` if standard error and standard out should be merged
Returns:
  an `Optional` describing the new process created, if an empty `Optional` is returned it is assumed that this factory is not capable of executing the provided command with the requested settings
Throws:
  `CoreException` - if the factory is capable of execution but the creation of a process itself has failed