Officials said the 6.4 magnitude quake struck in the Sunda Strait , off the western coast of Java island .