People decided to live on the coast of Japan because they thought that it was a safe and nice place to live. It was impossible to be reached by land, hence whenever enemies would come by sea the Japanese would then be able to spot them coming. Furthermore, since they lived near the ocean food was quite accessible as well.
Hope this answers the question