In a unified description of superconductor-normal-metal-superconductor
(SNS) and superconductor-semiconductor-superconductor (SSmS) junction
s with mean free paths exceeding the Nor Sm-layer thickness it is show
n how off-diagonal (Andreev) scattering from spatial variations of the
pair potential in competition with diagonal scattering from interface
potentials, mismatches of Fermi energies, and effective masses determ
ines the quasiparticle states and Josephson current densities. The bou
nd states with subgap energies provide the main channels for Cooper pa
ir transfer via Andreev scattering. Scattering states only contribute
to the net Cooper pair transfer in narrow ''resonance'' windows just a
bove the gap at energies which are a continuation of the bound-states
spectrum. The corresponding part of the Josephson current density flow
s in or against the direction of the bias current, depending upon the
phase difference and thickness of the nonsuperconducting layer. The cu
rrent contributions from the bound and scattering states oscillate opp
osite to each other as functions of this thickness. The weakening of p
hase coherence by increases of temperature and interface potentials an
d the corresponding approach to the sinusoidal current-phase relations
hip are discussed. Perturbation theory and comparison with the exact c
alculations show that the Bardeen-Johnson current density is exact in
the limit of thin-film SNS junctions and a good approximation in junct
ions with cross-sectional dimensions of the S-banks much larger than t
he London penetration depth, if the N-layer thickness 2a exceeds consi
derably the BCS coherence length xi0. The possibility of Josephson-Blo
ch oscillations in SSmS junctions is discussed.