TOKYO — It looked a little lonely up there.

During the short, solemn ceremony on Wednesday in which the new emperor of Japan, Naruhito, 59, accepted the sacred sword, jewels and seals that signify his right to sit on the throne, he was flanked by just two people. Standing ramrod straight to his right was his younger brother, Prince Akishino. To his left was his aging uncle, Prince Hitachi, who sat in a wheelchair.

It was striking visual evidence of the imperial family’s looming existential crisis: It has precious few heirs left.

Like Japan itself, the imperial family has a demographic problem. Just as Japan’s population is shrinking and aging, so is the royal family’s. The line of succession, which is limited to men, is only three people long.