Thread outThread = new Thread(stdout);
outThread = new Thread(stdout); outThread.setDaemon(true); outThread.setPriority(Thread.MIN_PRIORITY);
    public void start() throws IOException    {        if (process != null)            throw new IllegalStateException("Process already running!");        Runtime rt = Runtime.getRuntime();        List commandLine = new ArrayList();        commandLine.add("java");        commandLine.add("-classpath");        commandLine.add(getClasspath());        commandLine.add(mainClass);        if (args != null && args.length > 0)            commandLine.addAll(Arrays.asList(args));                String[] cmdarray = (String[]) commandLine.toArray(new String[commandLine.size()]);        process = rt.exec(cmdarray);        StreamCopier stdout = new StreamCopier(process.getInputStream(), out);        StreamCopier stderr = new StreamCopier(process.getErrorStream(), err);        Thread errThread = new Thread(stderr);        errThread.start();        Thread outThread = new Thread(stdout);        outThread.start();        log.info("Process started.");    }