JAKARTA - A magnitude 5.7 undersea earthquake struck the Indonesian islands of Java and Bali on Tuesday, sending tourists into a panic, and damaging dozens of temples and other buildings, according to Indonesian authorities.