The man was handed an 18-month sentence, suspended for four years, a Tokyo district court spokesman told AFP.
Kaoru Hasegawa was arrested in April on suspicion of illegally entering the premises of the junior high school that the prince attends.
He was also accused of violating Japan's firearms law.
The prince was not at school when the knives were apparently placed on his desk. They were later found by school officials.
Hisahito, 13, is the son of Emperor Naruhito's younger brother Akishino, who is first in line to the throne.
The presiding judge said Friday that Hasegawa "carried out the crime because of selfish thoughts that he wanted to get attention," according to public broadcaster NHK.
"There's no room for leniency," the judge said.
The incident came as authorities were beefing up security ahead of the abdication of the popular former emperor Akihito after a 30-year reign.
Threats to the imperial family are relatively rare. In 1975, Akihito was almost hit by a Molotov cocktail in Okinawa, a major World War II battlefield where there was strong anti-emperor sentiment.
Japan's Chrysanthemum Throne can only be inherited by a male heir, according to the Imperial Household Law, in place since 1947. That has raised the prospect of a succession crisis if Hisahito does not have a son.