-bash: java-version: command not found

操作步骤:

                进入服务器,输入:java -version

                返回:-bash: java-version: command not found

                输入:source /etc/profile

                再次输入:java -version

                显示JDK版本

 

 所以,重新进入服务器,需要source /etc/profile才能找到JDK。

 

解决方法:在~/.bashrc 里面加一句source /etc/profile,可解决。

                  1.用vim打开~/.bashrc 进行编辑

                     vim ~/.bashrc

                 2.在文件最后添加:

                    source /etc/profile

                 3.保存退出

                      Esc键    :wq

 

相关文章:

  • 2021-05-15
  • 2021-07-09
  • 2021-08-23
  • 2021-04-06
  • 2021-06-09
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2021-09-05
  • 2021-07-17
  • 2021-07-22
  • 2021-08-11
  • 2021-10-11
相关资源
相似解决方案