Jeremiah 22:2

And say, Hear the word of the LORD, O king of Judah, that sittest upon the throne of David, thou, and thy servants, and thy people that enter in by these gates:

The summons is addressed to the king of Judah who sits upon the throne of David, together with his servants and his people who enter in by the gates, commanding them all to hear the word of the Lord.
Hearing here means acting in justice and righteousness, and especially rescuing the oppressed from wrong.
It further requires protecting the stranger, the fatherless, and the widow, and doing no violence and shedding no innocent blood.

The promise to the royal house makes continued rule and blessing conditional on obedience to the commandments.
Refusal to hear and persistence in disobedience bring desolation upon the house.
The commandments themselves are given for the good and protection of the people, so that obedience is their life and keeping them brings reward.