It can often be hard to find out in advance for some countries whether they require six months validity or not, so the safest option is always ensuring your passport is renewed well before that six month period.
Fortunately though, for Japan, there's a fairly authoritative answer on this:
Some Asian countries require 6 months passport validity for me to enter. Does it apply to Japan?
The passport must remain valid during the period of the stay but there is no minimum period of validity required.
(from the FAQ page of the Consulate-General of Japan, Melbourne)
Note that this applies to entry, not neccessarily to a visa application (as noted by @TheWanderingCoder in the comments). If you do require a visa, it is likely that a six month validity will still apply to this (eg. Pre-College Student Visa, College Student Visa, Working Holiday Visa, Working Visa, etc).