Heat president Pat Riley knew he couldn’t keep them all in Miami, but losing James Jones to the Cleveland Cavaliers on Wednesday must have come as a mild surprise to the Miami Heat president.

Jones had said after the NBA Finals he wanted to remain with the Heat if they would have him, but now he’ll be wearing Cleveland colors alongside James next season. Jones reportedly agreed to a one-year contract for the veteran’s minimum.

It’s unclear if the Heat actually had plans to bring Jones back, but there’s no doubting the fact that the Heat is short a few veteran shooters at this point in the free agency process.

Someone with Jones’ unique expertise is valued on any roster, and James jumped at the opportunity to bring Jones with him to the Cleveland. Jones shot over 50 percent from three-point range last season in 20 games, and shot nearly 47 percent from the field in the 2014 playoffs.

For the Heat, he would have been a nice security blanket now that Shane Battier has retired and Rashard Lewis, late Tuesday night, agreed to a one-year contract with the Dallas Mavericks.

Jones, 33, spent six seasons with the Heat, winning two championships, and was valued for his work ethic and uncanny ability to come off the bench and make timely three-pointers.

But despite Jones’ expressed desire to stay with the Heat, James apparently recruited the Miami native and former Hurricanes star heavily. James, Jones and Ray Allen went on vacation together to the Bahamas after the Heat lost to the Spurs. At the time, that was viewed as positive sign for the Heat. On second thought, James might have been plotting to take Jones to Cleveland all along.

James received a commitment from another former Heat player on Tuesday when Mike Miller joined the Cavaliers. James values Jones and Miller for their ability to spread the floor offensively. James openly called for Jones to be inserted into the Heat’s rotation during the NBA playoffs. In Cleveland, Jones will be a valued mentor on a young team.

LEWIS GONE

Lewis is another valued locker-room presence who will be sorely missed in Miami. The veteran free agent agreed to play for the Mavericks next season for the veteran’s minimum, according to Yahoo Sports. Lewis played for two seasons with the Heat, winning a championship in 2013.

Lewis joins a revamped Mavericks team that recently signed Chandler Parsons as a restricted free agent. Lewis likely will back up Parsons. The Mavericks also added center Tyson Chandler, guard Raymond Felton, forward Richard Jefferson and center Greg Smith.

“Rashard made a difficult decision to join Dallas after two memorable seasons in Miami,” agent Colin Bryant told Yahoo Sports. “He would like to thank [Heat owner] Micky Arison, [executives] Pat Riley, Andy Elisburg and the entire Heat organization. He will always consider them family and champions.”