An earthquake with a preliminary magnitude of 4.9 shook buildings in Tokyo on Wednesday, but no tsunami warning was issued and there were no immediate reports of damage or injuries.