Joakim Noah underwent surgery on his right shoulder Wednesday to repair his rotator cuff, the Knicks announced Thursday morning.

No timetable was given for his return, but Knicks coach Jeff Hornacek said before the team’s final game that the rehab process is five months. Noah could be back for training camp, which starts in late September.

Dr. David Altchek performed the procedure at the Hospital for Special Surgery in Manhattan, the team said.

Knicks doctors recommended surgery two weeks ago on the issue that had bothered Noah since January. But the veteran center was still mulling whether to have it. Hornacek said he was hoping Noah would make the decision sooner than later because of how long the recovery time is.

It was a disappointing season for Noah after team president Phil Jackson gave him a four-year, $72 million contract.

Brought in to be an inspirational leader and defensive anchor, Noah played in just 46 games and averaged 5 points and 8.7 rebounds. The Knicks finished 31-51 and were one of the worst defensive teams in the league.

Noah had an injury-plagued season that ultimately ended with him being suspended for violating the terms of the NBA’s anti-drug policy.

advertisement | advertise on newsday

He was suspended 20 games for taking a banned supplement. Noah served eight games at the end of the season. He will be suspended the first 12 games in 2017-18. He also was slowed by hamstring injury and had his left-knee scoped in late February.

Noah, 32, has had several injuries the last few seasons. He played just 29 games the prior season with the Bulls when he needed surgery to repair a dislocated left shoulder.

But Jackson is hopeful that Noah will become the player he envisioned when he signed him to the big contract last summer. Noah still has three years and $55 million remaining on his deal.

“He’s relatively young,” Jackson said at his end-of-season news conference April 14. “He has a great heart in the sky. He’s got passion for the game. Defensively he was Defensive Player of the Year. All those things jumped out at me about a really good thing.

“We talked a lot about, ‘Can you get yourself back into this condition? Hamstrings, hamstrings, hamstrings. Eventually it ended up being the knee that was creating ultimately other problems. So we hope going forward – he expresses great dedication in getting back to what he was and who he is as a basketball player. So I have to trust him in that.”