The problem of vortex structure in a single Josephson junction in an external magnetic field, in the absence of transport currents, is reconsidered from a new mathematical point of view. In particular, we derive a complete set of exact analytical solutions representing all the stationary points (minima and saddle-points) of the relevant Gibbs free-energy functional. The type of these solutions is determined by explicit evaluation of the second variation of the Gibbs free-energy functional. The stable (physical) solutions minimizing the Gibbs free-energy functional form an infinite set and are labelled by a topological number Nv = 0, 1, 2, . . .. Mathematically, they can be interpreted as nontrivial "vacuum" (Nv = 0) and static topological solitons (Nv = 1, 2, . . .) of the sine-Gordon equation for the phase difference in a finite spatial interval: solutions of this kind were not considered in previous literature. Physically, they represent the Meissner state (Nv = 0) and Josephson vortices (Nv = 1, 2, . . .). Major properties of the new physical solutions are thoroughly discussed. An exact, closed-form analytical expression for the Gibbs free energy is derived and analyzed numerically. Unstable (saddle-point) solutions are also classified and discussed.