先上一张错误图:
使用SSH远程调用命令出现command not found。
解决方案如下——》
由于我的java的环境变量是配置在~/.bash_profile中的,所以:
#添加source ~/.bash_profile;
ssh cassandra20 "source ~/.bash_profile;java -version"
结果入下:
详细原因请看(很有用):
https://blog.youkuaiyun.com/whitehack/article/details/51705889