Critical current semiconductor nanowire Josephson junctions in the presence of magnetic field