public static File findProgramOnPath(String name) {
		checkNotNull(name);
		checkArgument(!name.contains(SystemUtils.FILE_SEPARATOR));
		
		// people trying to execute .com and other weird files are out of luck
		if(SystemUtils.IS_OS_WINDOWS && !name.endsWith(".exe"))
			name = name + ".exe";
		
		String[] paths = StringUtils.split(System.getenv("PATH"), 
				SystemUtils.PATH_SEPARATOR);
		
		for(String path : paths) {
			File program = new File(path, name);
			if(program.exists())
				return program;
		}
		
		return null;
	}