added support for java8, output printed to console