java代码获取系统时间相差8小时

 

在catalina.sh中配置:JAVA_OPTS-Duser.timezone=”Asia/Shanghai”

参考:http://www.iteye.com/problems/63592