We tune the barrier of a Josephson junction through a zero-temperature meta
l-insulator transition and study the thermodynamic behavior of the junction
in the proximity of the quantum-critical point. We examine a short-coheren
ce-length superconductor and a barrier (that is described by a Falicov-Kimb
all model) using the local approximation and dynamical mean-field theory. T
he inhomogeneous system is self-consistently solved by performing a Fourier
transformation in the planar momentum and exactly inverting the remaining
one-dimensional matrix with the renormalized perturbation expansion. Our re
sults show a delicate interplay between oscillations on the scale of the Fe
rmi wavelength and pair-field correlations on the scale of the coherence le
ngth, variations in the current-phase relationship, and dramatic changes in
the characteristic voltage as a function of the barrier thickness or corre
lation strength (which can lead to an "intrinsic" pinhole effect).