Since we are concerned about large $x$, we assume $x>1$ at the beginning.
To proceed, consider introducing a parameter
$$
f(a)={1\over2\pi i}\oint_\Gamma{x^s\over s}\log{1\over s/a-1}\mathrm ds
$$
where $\Gamma$ rotates around $s=a$.
so all we need is to find $f(1)$. To proceed, we differentiate on both side to get
$$
f'(a)={1\over2\pi i}\oint_\Gamma{x^s\over s}\left[\frac1a+{1\over s-a}\right]\mathrm ds={x^a\over a}
$$
In order to proceed, we consider integrating through the straight path connecting $a=-\infty$ and $a=1+\delta i$ (with $\delta\in\mathbb R$). This means we have
$$
f(1+i\delta)=\int_{-\infty}^{1+\delta i}{x^a\over a}\mathrm da=\int_{-\infty}^{(1+\delta i)\log x}{e^t\over t}\mathrm dt
$$
Now, we deform the path into horizontal segment from $-\infty$ to $-\delta$, an arc going through $-|\delta|$, $i\delta$, and $|\delta|$
$$
f(1+i\delta)=\int_{-\infty}^{-|\delta|}+\int_\delta^{(1+|\delta|i)\log x}{e^t\over t}\mathrm dt+\int_{-|\delta|}^{|\delta|}{e^t\over t}\mathrm dt
$$
when $\delta>0$, we have
$$
\int_{-|\delta|}^{|\delta|}{e^t\over t}\mathrm dt=-i\pi
$$
when $\delta<0$ the RHS changes sign. Consequently, we obtain $f(1)$ by calculating its Cauchy principal value:
$$
\begin{aligned}
f(1)
&\triangleq\lim_{\delta\to0^+}{f(1+i\delta)+f(1-i\delta)\over2} \\
&=\lim_{\delta\to0^+}\int_{-\infty}^{-\delta}+\int_\delta^{\log x}{e^t\over t}\mathrm dt \\
&=\lim_{\delta\to0^+}\int_0^{1-\delta}+\int_{1+\delta}^x{\mathrm dt\over\log t} \\
&=\operatorname{li}(x)
\end{aligned}
$$
Conclusively, we obtain the prime number theorem in the form of
$$
J(x)=\operatorname{li}(x)+\mathcal O\left(xe^{-c\log^{1/10}x}\right)
$$