For a pre-1900 PoD you would probably need to get rid of the Confucian bureaucracy. The Confucians were always more enamored with the idea of 'uniting the world by virtue", and the vassal system, graded in terms of Chinese-ness, sort of sprung from that. More pragmatically they were also fearful of imperial overstretch, fueled by examples from the fall of the Qin and Sui, and so OTL they did play a role in stopping many an aspiring conqueror (notably Qianlong).
Of course, there is some research that shows that the Chinese 'strategic view' wasn't really as defensive or peaceful as popularly thought of (at least, in terms of the Ming strategy against Mongols); but given that an Imperial invasion of Japan would require significant investment I can't imagine that a Confucian bureaucracy would allow it, unless you had a particularly strong/tyrannical emperor in power.
Probably the best time to do it is during the Yuan Dynasty (yeah it's not Chinese but still), when the disparity between Japan and China was probably the largest. The Tang is also a good bet, and so is the Qin had it lived longer. Early Chinese industrialization might also be a prelude to Japan conquest, though of course it's risky to assume that China will go colonial just because it industrialized.