NiMH charging circuit using 24V
But the '1' from J1 has to connect somewhere right?


Yep!

Your first diagram is on the right track, much better than the second diagram, regarding the connections at J1 and J2. 

Be aware that you've got negative on pin 1 on one side, and on pin 2 on the other side. This could cause confusion when connecting the batteries.


  Is ground just the same thing as the negative terminal on a battery?


It's not exactly the same thing, but it's often treated as the same thing. You can consider ground equivalent to the negative terminal in this application.

Regarding your circuit though, I think you should have a resistor voltage divider to set the LM317 output voltage to ~18V. This page might help to get some sample values: https://circuitdigest.com/calculators/lm317-resistor-voltage-calculator