The court found Kathawut Boonpitak guilty of violating the lese majeste law, which punishes people who defame, insult or threaten the monarchy, over comments he made on a program aired on his website in March, said Sasinan Thamnithinan, one of the lawyers representing the defendant.
Thailand's lese majeste law is the world's harshest, providing for jail terms of three to 15 years.
After invoking martial law and staging a May 22 coup, the military has intensified a crackdown on criticism of the monarchy and announced that prosecution of all such cases will be in military courts.
Sasinan, who works for the Thai Lawyers for Human Rights Center, said the court reduced Kathawut's prison term from 10 years because he had confessed to the offense.
However, she said the sentence was long compared to civilian courts, which usually give about three to five years' imprisonment if a defendant does not plead guilty.
Under martial law, the verdicts of military courts cannot be appealed by the defendant.
Kathawut was summoned by the junta in June and has been in military and police custody since then.
King Bhumibol Adulyadej, 86, the world's longest-reigning monarch, is in poor health. His fading from public life and the palace's perceived role in political battles that began in 2006 have tarnished the institution in recent years, undermining what had previously been near-universal respect for the royal institution.