public static void runCommand(String path, String options,String input) {
		Object lockStdOut = new Object();
		Object lockStdErr = new Object();
		Process process = null;
		OsUtils.errors=new StringBuffer();
		OsUtils.result = new StringBuffer();
		try {
			//create a new process for dlv
			process = Runtime.getRuntime().exec(path+options);
		} catch (IOException e) {
			System.err.println(e.getMessage());
		}   
		      
		StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(),"ERROR",lockStdErr);
		StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(),"STDOUT",lockStdOut);
		// kick them off
		errorGobbler.start();
		outputGobbler.start();
		try {
			// write the provided input to the process
			if(input != null) {
				OutputStream stdin = process.getOutputStream();	 
				stdin.write(input.getBytes(), 0, input.length());
				stdin.flush();
				stdin.close();
			}
			try {
				process.waitFor();			            				
			} catch (InterruptedException e) {
				e.printStackTrace();
			}

			// wait until error stream is ready:
			synchronized(lockStdErr){
				while (!errorGobbler.isReady()){
					try {
						lockStdErr.wait();
					} catch (InterruptedException e) {
						// This should never happen!
						e.printStackTrace();
					}
				}
			}

			// wait until std out stream is ready:
			synchronized(lockStdOut){
				while (!outputGobbler.isReady()){
					try {
						lockStdOut.wait();
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}    
		} catch (IOException ex) {
			ex.printStackTrace(); // this exception should not occur!
		}
	}