A powerful earthquake hit Japan’s northern island of Hokkaido early on Thursday, collapsing walls and some buildings but not triggering a tsunami.