James Alan stood quietly yesterday afternoon in a Hudson County Superior Court courtroom with an ear-to-ear smile on his face after a jury found him not guilty of aggravated assault and weapons charges.

Alan, 64, was accused of stabbing a 58-year-old homeless man in a restroom on Frank Sinatra Drive in Hoboken on Feb. 1, 2012.

Alan and defense attorney Yuri Aldrich maintained that Alan was attacked first and all he did was defend himself.

“Mr. Alan repeatedly told officers that he responded in self-defense,” Aldrich said during her closing statement. “He admitted that he didn’t know what he had stabbed him with, that he was cornered and attacked, and went to the Police Department after the incident to tell them that.”

Hudson County Assistant Prosecutor Shane Paugh said Alan and the man who was stabbed got into a shoving match over clothes. Paugh asserted that Alan left the restroom during the argument, only to return and stab the victim on the left side of his back.

“The defendant was already in a safe place outside the bathroom,” Paugh said during his closing statement, aiming to deflate Alan’s self-defense argument. “It was his choice to come back, and when (the alleged victim) was leaning against the sink he stabbed him.”

The jury returned the not guilty verdict on all three counts of aggravated assault, possession of a weapon for an unlawful purpose and bodily injury after a little more than three hours of deliberation.