fixed java version, add sleep on infinite while.