Jerusalem seems to be an exception to the rule that all ancient cities must either be on a river or freshwater lake.
First settlement is estimated at 3500 BC.
The nearest major river as far as I can tell from maps seems to be the Jordan River, at ~12mi.
From Wikipedia, which is citing Easton's Bible Dictionary, The Gihon Spring was
a reliable water source that made human settlement possible in ancient Jerusalem - the spring was not only used for drinking water, but also initially for irrigation of gardens.