A homemade bomb that was detonated outside an Upper East Side Starbucks last year injured no one — but authorities yesterday still made an example of the teen self-proclaimed “anarchist” who lit the fuse.

Kyle Shaw, 19, landed 3½ years behind bars for igniting the volatile box of fireworks powder outside the shop on East 92nd Street at Third Avenue over Memorial Day weekend in 2009.

“Anyone considering setting off a bomb in New York City should know they will be caught,” said Manhattan Assistant District Attorney Christopher Ryan, adding that authorities feared that Shaw was refining his bomb-making skills for future terror exploits.

Shaw and his parents teared up before the Chelsea teen was led off to prison.

The 3 a.m. blast was heard as far as 40 blocks away, and set off a 46-day manhunt. The blast site was visited by no less than the police commissioner, the mayor and Gov. Paterson.