Derivation (charge conservation in thin wire)

Require $$ \begin{align*} 0 &= ∇\cdot \v J(\v x) \\ &= I\int_{C} ∇δ(\v x-\v x') \cdot \d \v x' \\ &= -I\int_{C} ∇'δ(\v x-\v x') \cdot \d \v x' \\ &= -I\bigl(δ(\v x - \v x_2) - δ(\v x-\v x_1)\bigr) \end{align*} $$ if $C$ runs from $\v x_1$ to $\v x_2$.

If $C$ is finite, then $∇\cdot \v J(\v x) = 0$ for all finite $\v x$. Otherwise we need $\v x_1 = \v x_2$.