Japan is spending $40 million to build a base in Djibouti (on the northern border of Somalia), for its military personnel supporting the anti-piracy patrol. Most Japanese military personnel in the area are at sea, in warships. But now they have a place ashore to for supplies and maintenance facilities. Japan also has maritime patrol aircraft in Djibouti. All this is to help protect Japanese maritime trade, which is considerable. About ten percent of the merchant shipping passing through local waters, is carrying Japanese goods (either exports, or raw materials imports.)
The Japanese base won't be finished for another ten months. In the meantime, the Japanese use facilities in a nearby American base. The new base will be the first foreign Japanese military base since World War II.