1. The Korean Peninsula was not barren, but had been an independent kingdom/empire for centuries.
2. Chinese influence in Korea largely ended as a consequence of the 1895 treaty that ended the First Sino-Japanese War.
3. The cause of the 1904-1905 Russo-Japanese War was Russia and Japan trying to increase their influence/power in Korea.
4. Japanese occupation of Korea was a consequence of the Russo-Japanese War.
But whether your version of events is correct or mine, above, is correct, the Japanese were brutal conquerors and exploiter-enslavers. Their occupation of Korea had nothing to do with defending their interests against anything, and everything to do with building an empire in which Japan would be the exploiter and enslaver of those they ruled.
There's a very ugly but historically correct reason Japan is hated intensely in Korea and the eastern third or so of China, areas Japan conquered.
----------------------------
Permit me to correct my generalization.
North Korea is a barren rock-pile while the South has some agriculture.
As for Korea, it was never an Empire any more than Ganymede, a Moon of Jupiter.
As well, China and Japan have been adversaries since the Shang of 1500 BC.
Further, the notion of Korean autonomy/independence is mythology as it has
been an eternal pawn between China, Japan and Russia, literally forever.
Agree their occupation was harsh yet the Japanese did establish an education
system permitting the children of the vast peasant class to better themselves
over time which led to the economic development of South Korea after WW 2.