Ecclesiastes 11:9

7 Truly the light is sweet, and a pleasant thing it is for the eyes to behold the sun:

8 But if a man live many years, and rejoice in them all; yet let him remember the days of darkness; for they shall be many. All that cometh is vanity.

Rejoice, O young man, in thy youth; and let thy heart cheer thee in the days of thy youth, and walk in the ways of thine heart, and in the sight of thine eyes: but know thou, that for all these things God will bring thee into judgment.

10 Therefore remove sorrow from thy heart, and put away evil from thy flesh: for childhood and youth are vanity.

Do read the surrounding verses too, because the context often says more than a single verse.

Compare

BSB
Rejoice, O young man, while you are young, and let your heart be glad in the days of your youth. Walk in the ways of your heart and in the sight of your eyes, but know that for all these things God will bring you to judgment.
KJV
Rejoice, O young man, in thy youth; and let thy heart cheer thee in the days of thy youth, and walk in the ways of thine heart, and in the sight of thine eyes: but know thou, that for all these things God will bring thee into judgment.
WEB
Rejoice, young man, in your youth, and let your heart cheer you in the days of your youth, and walk in the ways of your heart, and in the sight of your eyes; but know that for all these things God will bring you into judgment.
ASV
Rejoice, O young man, in thy youth, and let thy heart cheer thee in the days of thy youth, and walk in the ways of thy heart, and in the sight of thine eyes; but know thou, that for all these things God will bring thee into judgment.
DARBY
Rejoice, young man, in thy youth; and let thy heart cheer thee in the days of thy youth, and walk in the ways of thy heart, and in the sight of thine eyes; but know that for all these [things] God will bring thee into judgment.
BLB
Rejoice, O young man, in your youth, and let your heart be made glad in the days of your youth. And walk in the ways of your heart, and in the sight of your eyes, and know that for all these [things] God will bring you into the judgment.
ÅB
Gled deg, du unge, i din ungdom og la ditt hjerte være vel til mote i din ungdoms dager og vandre på ditt hjertes veier og etter det dine øyne ser! Men vit at for alt dette vil Gud føre deg fram for dommen.
OTB
Vær glad, unge menneske, i din ungdom, og la ditt hjerte være lystig i dine ungdomsdager. Følg ditt hjertes tilbøyeligheter og dine øynes syn, men vit at Gud vil bringe deg til dom for alle disse tingene.
B1930
Gled dig, du unge, i din ungdom og la ditt hjerte være vel til mote i din ungdoms dager og vandre på ditt hjertes veier og efter det dine øine ser! Men vit at for alt dette vil Gud føre dig frem for dommen.

Study notes (Tyndale)

Original text and word study

Cross references