Brooklyn director Spike Lee is getting a retrospective in his old neighborhood, Fort Greene — despite his recent rants about gentrification in the borough.

The Brooklyn Academy of Music’s BAMcinématek program will launch “By Any Means Necessary: A Spike Lee Joints Retrospective” on June 29 with a 25th anniversary screening of “Do the Right Thing,” where Lee and the film’s cast, including Danny Aiello, Giancarlo Esposito and Bill Nunn, are expected.

Films screening through July 10 include a rare print of Lee’s 1983 project, “Joe’s Bed-Stuy Barbershop: We Cut Heads.”

It was Lee’s NYU master’s thesis, and classmate Ang Lee worked on the project.