  We investigate the Josephson effect through a molecular quantum dot magnet
connected to superconducting leads. The molecule contains a magnetic atom,
whose spin is assumed to be isotropic. It is coupled to the electron spin on
the dot via exchange coupling. Using the numerical renormalization group method
we calculate the Andreev levels and the supercurrent and examine intertwined
effect of the exchange coupling, Kondo correlation, and superconductivity on
the current. Exchange coupling typically suppresses the Kondo correlation so
that the system undergoes a phase transition from 0 to $\pi$ state as the
modulus of exchange coupling increases. Antiferromagnetic coupling is found to
drive exotic transitions: the reentrance to the $\pi$ state for a small
superconducting gap and the restoration of 0 state for large antiferromagnetic
exchange coupling. We suggest that the asymmetric dependence of supercurrent on
the exchange coupling could be used as to detect its sign in experiments.
