4 As for you, if you will go on your way before me, as David your father did, uprightly and with a true heart, doing what I have given you orders to do, keeping my laws and my decisions; 5 Then I will make the seat of your rule over Israel certain for ever, as I gave my word to David your father, saying, You will never be without a man to be king in Israel. 6 But if you are turned from my ways, you or your children, and do not keep my orders and my laws which I have put before you, but go and make yourselves servants to other gods and give them worship: 7 Then I will have Israel cut off from the land which I have given them; and this house, which I have made holy for myself, I will put away from before my eyes; and Israel will be a public example, and a word of shame among all peoples.
Matthew Henry's Commentary on 1 Kings 9:4-7
Commentary on 1 Kings 9:1-9
(Read 1 Kings 9:1-9)
God warned Solomon, now he had newly built and dedicated the temple, that he and his people might not be high-minded, but fear. After all the services we can perform, we stand upon the same terms with the Lord as before. Nothing can purchase for us liberty to sin, nor would the true believer desire such a licence. He would rather be chastened of the Lord, than be allowed to go on with ease and prosperity in sin.