  We develop and study theoretically a minimal model of semiconductor nanowire
Josephson junction that incorporates Zeeman and spin-orbit effects. The DC
Josephson current is evaluated from the phase-dependent energies of Andreev
levels. Upon changing the magnetic field applied, the critical current
oscillates manifesting cusps that signal the $0$-$\pi$ transition. Without
spin-orbit interaction, the oscillations and positions of cusps are regular and
do not depend on the direction of magnetic field. In the presence of spin-orbit
interaction, the magnetic field dependence of the current becomes anisotropic
and irregular. We investigate this dependence in detail and show that it may be
used to characterize the strength and direction of spin-orbit interaction in
experiments with nanowires.
