-bash: java: command not found 问题处理

1、问题背景

在Linux系统上安装java环境时,使用vi /etc/profile命令写完后,使用java -version 提示-bash: java: command not found

2、解决方案

在vi /etc/profile 编辑完文件后,还需使用命令source /etc/profile 使其生效
在这里插入图片描述然后输入java -version进行测试成功
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/hsuehgw/article/details/128922331