Beijing asserts sovereignty over almost all of the resource-rich South China Sea, despite rival claims from Southeast Asian neighbours.
Indonesia has no dispute with China over ownership of reefs or islets.
But China's expansive claims overlap with Indonesia's exclusive economic zone — waters where a state has the right to exploit resources — around the Natunas, a remote scattering of islands with rich fishing grounds.
In June Indonesian President Joko Widodo toured the islands on a warship, in a move seen sending a strong message to Beijing to respect his country's sovereignty.
In Tokyo, Indonesia's coordinating minister for maritime affairs Luhut Panjaitan and Japanese Foreign Minister Fumio Kishida met to exchange documents to launch the cooperation framework, including in maritime security and economic development in remote islets.
"Japan highly values cooperation with Indonesia in maritime affairs," Kishida told Panjaitan.
The agreement is aimed at helping Indonesia strengthen its capacity in maritime security and promote economic development of remote islands, a foreign ministry official told AFP.
Australia has earlier said it is considering joint patrols with Indonesia in the South China Sea.
Japan, which has a territorial row with China over disputed islands in the East China Sea, has worked to strengthen ties with members of the Association of Southeast Asian Nations, repeatedly stressing maritime disputes should be addressed according to law.
The Philippines took China to the Hague-based Permanent Court of Arbitration, which ruled in July there was no legal basis to China's claims — a verdict Beijing vehemently dismissed. (source)