In this paper, we prove that for any Kähler metrics ω and χ on M, there exists a Kähler metric ω_φ = ω_0 + √-1 ∂ \bar∂ φ > 0 satisfying the J-equation tr_{ω_φ} χ = c if and only if (M, [ω0], [χ]) is uniformly J-stable. As a corollary, we find a sufficient condition for the existence of constant scalar curvature Kähler metrics with c_1 < 0. Using the same method, we also prove a similar result for the supercritical deformed Hermitian–Yang–Mills equation.