The magnetization curves and phase, field, and current-density profiles for uniform Josephson junctions (JJs) with length 2L are calculated from the sine-Gordon equation. It is found that M starts to be a multivalued function of H at l = L/lambda(J) = l(c) = 1.995, lambda(J), being the Josephson penetration depth; when l > l(c), increasing and decreasing H will cause M to jump so that hysteresis loops are formed; the hysteresis loops of very long JJs with l >> l(c), have a shape similar to that of type-II superconductors (SC2s) with a surface barrier but both have quantitative differences; being cooled in a constant field, JJs show a Meissner effect distinct from that of SC2s. These results are explained in terms of Josephson vortices. One of the most fundamental differences between JJs and SC2s is that there is a surface current separated from the vortices for the latter but not for the former.