Its not much to do with Japan investing heavily into China.
Its more of the special arrangements both countries has made economically.

Whereby Japan sell China the technology to produce goods. The Japanese buy Made in China goods. And with the Chinese middle class rising will buy Made in Japan goods.

The best minds of China are now being educated in Japan and the best engineers in Japan are now recruited by Chinese companies.