This question is another side of that question
If I want to launch some command over ssh connection, I provide ~/.ssh/environment file with variables there (but it does not allow me to use bash command there..)
But if I want to launch some command with sudo (like sudo java, for example), usually I put the following line to my .bashrc file
alias sudo='sudo env PATH=$PATH'
So, I can NOT put this alias into my ~/.ssh/environment file, because it does not support any commands.
So, what it is the best way to fix it in this case?