Japan has abandoned the military forces right after the WWII. Although there were samurai throughout the nation, modern army and navy were created in the middle of the 19th century. At first, all weapons and vessels were bought from Europe or US, but gradually Japan produced their own weapons and vessels.
Due to geographically location, Japan had to strengthen their navy. Battleships, destroyers, submarines and aircraft carriers were built rapidly from the end of 19th century to end of WWII. At the time of WWII, Japanese navy was considered the third strongest navy in the world, after USA and UK.
Not like the aircraft manufactures Mitsubishi and Nakajima which productions of any type of aircraft were banned, vessel manufactures shifted their productions to civilian vessels after the war. Then, finally the glory of Japan is continuing longer than before the war, commercial success was bigger than military success.
Japan abandoned the military forces but later created the self defense forces. However, the self defense forces are strictly monitored by the new constitution introduced after the war. Therefore Japan has signed the treaty with US. Even now, US has a plenty of military bases in Japan. Their main bases are located in Okinawa prefecture but there are significant naval base in Sasebo, Nagasaki prefecture.
Sasebo was a small fishing village during Edo era, before the capital moved from Kyoto to Tokyo. Then, the government recognized its strategical location and natural harbor, huge naval base was created in Sasebo. After the war, US made their own naval base too. By the way, these bases are off limits and normal civilians cannot enter.