I shouldn't have told him. I risked everything by telling him what i thought
You risked nothing by by telling him. What you gained was the ability to now go zero contact because you know that he's NOT FEELING the same things as you are. He doesn't not want you the way you want him and he's told you that in both words and actions that match his words.
He's done you a huge favor by telling you not to wait for him. That's what decent people do instead of stringing you along and taking anything you'd be silly enough to give when he's not loving you back.
It will hurt for a while as you go through the withdrawl of having him in your life but when you're over him by giving it time and doing good things with that time, and on your way to indifference to him you'll now be open in both heart and mind to find a good guy that wants you like you want him. This guy does not love you. He'll never be ready to be in a romantic relationship with you because he knows you're not the girl he wants to spend the rest of his life with. If you were, then he would have made it so by now when knowing how you feel for him. That's the hard truth.
You will be fine, I promise but you have to go zero contact now and don't respond to any of his attempts to contact you (if he makes any)... it will just keep you stagnated in the pit you're in right now if you do.
“The willingness to accept responsibility for one’s own life is the source from which self-respect springs.” ~Joan Didion