Jacobian for point on robotic arm

currently i am programming for a robotic simulation. I have a Endeffector which aproaches a target, on the way to the target is an Obstacle. Now i redirect my Endeffector, so that it does not hit the target.

When i want to do the same for the whole arm i want to push the arm away from the Obstacle as well. Now i have it working so far that i can redirect the arm. But my calculation for the Jacobian seems to be faulty.

For my setup, and what i need for that.

I have a robotic arm, 7DOF. Let $x_0$ be the closest point on the arm to the obstacle. And $J_0$ the corresponding Jacobian. Also i have given the following term: $\dot{x_0} = J_0 * \dot{\theta}$

$\theta$ are my joint angles. I can calculate the Jacobian for the EndEffector, but do not know on how to calculate it for a point ob the arm.

Does anybody have an Idea on how to calculate the corresponding Jacobian.

Cheers