Add scanner support for java6.