A Commentary, Critical, Practical, and Explanatory on the Old and New Testaments, by Robert Jamieson, A.R. Fausset and David Brown  at sacred-texts.com
ecc 6:1(Ecc 6:1-12)
common--or else more literally,--"great upon man," falls heavily upon man.
ecc 6:2for his soul--that is, his enjoyment.
God giveth him not power to eat--This distinguishes him from the "rich" man in Ecc 5:19. "God hath given" distinguishes him also from the man who got his wealth by "oppression" (Ecc 5:8, Ecc 5:10).
stranger--those not akin, nay, even hostile to him (Jer 51:51; Lam 5:2; Hos 7:9). He seems to have it in his "power" to do as he will with his wealth, but an unseen power gives him up to his own avarice: God wills that he should toil for "a stranger" (Ecc 2:26), who has found favor in God's sight.
ecc 6:3Even if a man (of this character) have very many (equivalent to "a hundred," Kg2 10:1) children, and not have a "stranger" as his heir (Ecc 6:2), and live long ("days of years" express the brevity of life at its best, Gen 47:9), yet enjoy no real "good" in life, and lie unhonored, without "burial," at death (Kg2 9:26, Kg2 9:35), the embryo is better than he. In the East to be without burial is the greatest degradation. "Better the fruit that drops from the tree before it is ripe than that left to hang on till rotten" [HENRY].
ecc 6:4he--rather "it," "the untimely birth." So "its," not "his name."
with vanity--to no purpose; a type of the driftless existence of him who makes riches the chief good.
darkness--of the abortive; a type of the unhonored death and dark future beyond the grave of the avaricious.
ecc 6:5this--yet "it has more rest than" the toiling, gloomy miser.
ecc 6:6If the miser's length of "life" be thought to raise him above the abortive, Solomon answers that long life, without enjoying real good, is but lengthened misery, and riches cannot exempt him from going whither "all go." He is fit neither for life, nor death, nor eternity.
ecc 6:7man--rather, "the man," namely, the miser (Ecc 6:3-6). For not all men labor for the mouth, that is, for selfish gratification.
appetite--Hebrew, "the soul." The insatiability of the desire prevents that which is the only end proposed in toils, namely, self-gratification; "the man" thus gets no "good" out of his wealth (Ecc 6:3).
ecc 6:8For--"However" [MAURER]. The "for" means (in contrast to the insatiability of the miser), For what else is the advantage which the wise man hath above the fool?"
What--advantage, that is, superiority, above him who knows not how to walk uprightly
hath the poor who knoweth to walk before the living?--that is, to use and enjoy life aright (Ecc 5:18-19), a cheerful, thankful, godly "walk" (Psa 116:9).
ecc 6:9Answer to the question in Ecc 6:8. This is the advantage:
Better is the sight of the eyes--the wise man's godly enjoyment of present seen blessings
than the (fool's) wandering--literally, walking (Psa 73:9), of the desire, that is, vague, insatiable desires for what he has not (Ecc 6:7; Heb 13:5).
this--restless wandering of desire, and not enjoying contentedly the present (Ti1 6:6, Ti1 6:8).
ecc 6:10Part II begins here. Since man's toils are vain, what is the chief good? (Ecc 6:12). The answer is contained in the rest of the book.
That which hath been--man's various circumstances
is named already--not only has existed, Ecc 1:9; Ecc 3:15, but has received its just name, "vanity," long ago,
and it is known that it--vanity
is man--Hebrew, "Adam," equivalent to man "of red dust," as his Creator appropriately named him from his frailty.
neither may he contend, &c.-- (Rom 9:20).
ecc 6:11"Seeing" that man cannot escape from the "vanity," which by God's "mighty" will is inherent in earthly things, and cannot call in question God's wisdom in these dispensations (equivalent to "contend," &c.),
what is man the better--of these vain things as regards the chief good? None whatever.
ecc 6:12For who knoweth, &c.--The ungodly know not what is really "good" during life, nor "what shall be after them," that is, what will be the event of their undertakings (Ecc 3:22; Ecc 8:7). The godly might be tempted to "contend with God" (Ecc 6:10) as to His dispensations; but they cannot fully know the wise purposes served by them now and hereafter. Their sufferings from the oppressors are more really good for them than cloudless prosperity; sinners are being allowed to fill up their measure of guilt. Retribution in part vindicates God's ways even now. The judgment shall make all clear. In Ecc. 7:1-29, he states what is good, in answer to this verse.