James Dolan never got over losing LeBron James to Pat Riley and the Miami Heat in 2010. And he swore that it would never happen again.

Dolan, the chairman of Madison Square Garden, believes that to get the superstars you need a star as your closer. The Heat has Riley, and now Dolan has Jackson, the winner of 11 titles as a head coach and two as a player.

The fact that Jackson has never run a front office didn’t matter to Dolan. Nor did the outrageous price tag. It cost Dolan a king’s ransom to convince Jackson to leave his beach house for the shark-infested corporate waters at MSG. But it will be money well-spent if Jackson can land the King as well as Kevin Love or Kevin Durant over the next three years.

Jackson is 68 and for weeks he told close friends that his dream job would be a consulting gig. He never figured Dolan would come calling with the chance to rescue the franchise that drafted him.

Jackson is not in this for the long haul. His plan is to get the Knicks back to an elite status quickly, and the only way to do that is via free agency.

The Knicks can have salary flexibility next summer, when Love and Rajon Rondo are available. Durant is free in 2016.

James can opt out this summer and unless he signs a one-year deal or waits until 2015 to opt out, the Knicks have little chance of landing him.

But Dolan and Jackson can dream big. Heat executives, according to a source, are not convinced that James will stay, though in their heart of hearts they believe he will re-sign. But Jackson’s arrival changes things.

“There’s no way LeBron would have gone to New York under the current climate,” said a James confidant. “He had a falling-out with CAA (agency) and that was a problem as well. But with Phil there I think he will look at it.”

CAA represents, among others, Carmelo Anthony, J.R. Smith, Andrea Bargnani and Mike Woodson. No one was complaining about CAA’s involvement last season when the Knicks were winning 54 games. But Dolan appears ready to move on from the agency that James left two years ago.