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