revised collectJars and added Windows version (not yet tested)