"Teach me, O Lord, the way of your statutes;
and I will keep it to the end.
Give me understanding, that I may keep your law
and observe it with my whole heart.
Lead me in the path of your commandments,
for I delight in it.
Incline my heart to your testimonies,
and not to selfish gain!
Turn my eyes from looking at worthless things;
and give me life in your ways.
Confirm to your servant your
that you may be feared. Turn way the reproach that I dread,
for you rules are good.
Behold, I long for your precepts;
in your righteousness give me life!
Normally, when we want to study what the Bible says about meaning, we find our fingers perusing the writ of Ecclesiastes. "Meaningless! Meaningless!" we read. Over and over, the author says life is vanity. Whether one has wisdom or none, riches or none, pleasure or none, righteousness or none--everything is in vain. We hope he changes his mind, and at times, it appears he does, especially at the end: "The end of the matter; all has been heard. Fear God and keep his commandments, for this is the whole duty of man." It is an abrupt conclusion to an otherwise scathing, repetitive rant of how awful life is, so it is difficult to understand how much power the conclusion has for the motif of the book. However, we are told to fear God in many places throughout: (3:14; 5:2, 6, 7; 7:14,18, 26; 8:12, 11:9;12:1-8). Most of these admonitions regard the final judgment after death. Perhaps this is why the author sees life as vanity....
Ecclesiastes is a mysterious book: is the author stating the lamented facts, or is he merely lamenting, and disclosing the thoughts and feelings of a depressed human being thinking in the wrong way? Is the book from his own point of view, or is this the way God himself wants us to think?
It seems difficult to square the idea of seeing life as ultimately meaningless with the rest of Scripture, especially since the rest of the canon discusses "joy in the Lord" over and over. Think of Jesus' urge to love one another that our joy may be full (John 15:11-12). Think also of Paul's famous statement, "For to me to live is Christ and to die is gain" (Phil. 1:21), written in the "letter of joy," as it were, written from prison no less. Think of the Psalms. Even Ecclesiastes says, "And I commend joy, for man has no good thing under the sun but to eat and drink and be joyful, for this will go with him in his toil through the days of his life that God has given him under the sun," (8:15).
Nevertheless, just flipping my Bible open, I happened upon Psalm 119 before I got to Ecclesiastes. Here, the writer says he "delights" v.(35) in God's law, and that God's law is worth "keeping" (v.33). Moreover, he wants to "observe it with [his] whole heart," (v.34). He recognizes things of worth, and things "worthless," (v.37); the essence of these things are noted because of what God says about them in his law. Finally, he says, "I long for your precepts; in your righteousness give me life!"
That human longing exists is no secret. However, this longing comes to fruition when subsumed in and consumed by the law of God, his righteousness, and the life given through keeping covenant with God. In addition, human longing finding its telos in the life of God simply makes sense, due to the fact that we are made in the image of God, and in the gospel we are renewed by faith in the life of Jesus, having union and communion with him in the life of the Holy Spirit, being recreated after his image, which is a life of joy (1 Thes. 1:6).