  Let $X$ be a compact K\"ahler manifold and let $\mu$ be a non-pluripolar
measure on $X$. We give a necessary and sufficient condition for $\mu$ so that
the complex Monge-Amp\`ere equation (in a K\"ahler class in $X$) having $\mu$
as the right-hand side admits a bounded solution. This implies in particular a
well-known conjecture of Kolodziej that a complex Monge-Amp\`ere equation on
$X$ admits a bounded solution if it has a bounded subsolution.
