Film about a boy with a supernatural jar

All I remember from the film is a boy living on a farm with his grandfather, and he had a magic jar.
The jar could capture bad spirits and ailments as well as provide immortality.
The film ends with the boy, now an old man, opening the jar and passing away under a tree on the farm.

The education of little tree?

I checked out “The education of little tree” and it’s not the one …
The highlight of this movie was this magical jar the boy possessed.

Thank you very much for the step in the right direction … I found the movie … it’s called “The Man Who Caught Death in a Sack”.

Thanks for all your help.