Java Thread version.