support python3 and windows

* change print to print() to compatible with python3.
* change path separator from '/' to os.sep.
* change classpath separator from ':' to ';'.
* decode buffer to str to compatible with python3.