public static boolean start(String programpath, String command, boolean printOutput, String possibleErrorString) throws IOException,
    InterruptedException {
        if (command == null) {
            command = "";
        }

        boolean ret = true;
        output = "";

        Runtime rt = Runtime.getRuntime();
        Process pr = rt.exec(programpath + command);

        if (printOutput) {
            try (BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()))) {
                String line = null;

                while ((line = input.readLine()) != null) {
                    LOGGER.debug(programpath + "> " + line);
                    output += line;

                    if ((possibleErrorString != null) && !possibleErrorString.equals("") && line.contains(possibleErrorString)) {
                        ret = false;
                    }
                }
                input.close();

            } catch (IOException e) {
                throw e;
            }
        }

        LOGGER.debug("External program exited with status: " + pr.waitFor());
        return ret;
    }