An earthquake with a preliminary magnitude of 5.7 hit Japan’s northern island of Hokkaido on Thursday, the Japan Meteorological Agency said.