private int runCommand(File directory, List<String> command, String envvar, String value)
			throws IOException, InterruptedException {
		ProcessBuilder processBuilder = new ProcessBuilder(command);
		processBuilder.directory(directory);		// Set the working directory
		if (envvar != null) {
			Map<String, String> environment = processBuilder.environment();
			environment.put(envvar, value);
		}
		Process process = processBuilder.start();

		new IOThread(process.getInputStream(), true).start();
		IOThread errThread = new IOThread(process.getErrorStream(), false);
		errThread.start();
		errThread.join(); // Ensure all stderr output is processed to avoid mixed-up console output

		int retval = process.waitFor();
		return retval;
	}
Invoke an external executable/command, display the output and error streams on the console,
and return the exit value of the command.  
@param directory	 is the working directory for the command
@param command    is the command-line (including arguments)
@param envvar     if non-null, is an environment variable to set for the command
@param value      is the corresponding environment variable value
@return the exit status of the command (0=no error)
@throws IOException if the process cannot be started
@throws InterruptedException if there is a problem waiting for the process to finish
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java