Can somebody explain me the difference between only and just? In which cases we can use them?
ex: I need just one glass of water, i need only one glass of water
In practice there would rarely be any significant difference in meaning between OP's two alternatives, but to the extent that they could carry different implications, it's that...
1: I need just one glass of water
All I need is a glass of water (not food, a bed for the night, or anything else significant)
2: I need only one glass of water
I don't need more than one glass of water (one glass is enough)
It's worth noting that #1 above could be used with the same sense as given for #2. The sense I've given for it would more often be expressed as...
3: I just need a/one glass of water