But why are they in Japan?...............
Maybe the stash belonged to an international trader or company that did business in China?
From some wikipedia research, it seems that 1000 of those coins was equivalent to a silver tael (which was approximately a British Pound sterling).
From 1600s-1700s, 4-5 of those coins would buy you about 1 pound of rice.