Make java 1.6 compatible

Signed-off-by: happymap <nafan628@gmail.com>
Signed-off-by: Yudi Fu <yudi.fu@turn.com>