An earthquake with a preliminary magnitude of 5.5 shook eastern Japan, including Tokyo, on Tuesday, but there was no danger of a tsunami, the meteorological agency said.