ISHIGAKI, Japan—Japan’s military is laying the groundwork for batteries of antiship and antiaircraft missiles in a quiet, sugar-cane-filled valley here, as it girds to confront what Tokyo views as its greatest long-term threat: China.

Ishigaki is one of a string of subtropical islands in the far southwest of the Japanese archipelago—the closest is about 200 miles from China—that defense officials are fortifying with troop garrisons, weapons and a radar installation.

As...