TOKYO - An earthquake with a magnitude of 4.2 struck northern Hokkaido early Thursday and measured lower 5 on the Japanese seismic intensity scale of 7, Japan's weather agency said.