腾讯云centos7安装jdk有java没有javac -bash: javac: 未找到下令
一开始自动安装jdk的时候,输入java -version是有版本的,并且也执行了yum install java-devel。几乎没有标题。末了跑spark的时候,发现javac -version无法执行。搞了很久,末了决定重新安装jdk。再执行yum install java-devel就安装成功了首先删除现有的jdk
# yum -y remove tzdata-java.noarch
# rpm -qa | grep java
javapackages-tools-3.4.1-11.el7.noarch
java-1.8.0-openjdk-javadoc-1.8.0.362.b08-1.el7_9.noarch
python-javapackages-3.4.1-11.el7.noarch
java-1.8.0-openjdk-javadoc-zip-1.8.0.362.b08-1.el7_9.noarch
# ^C
# rpm -e --nodeps javapackages-tools-3.4.1-11.el7.noarch
# rpm -e --nodeps java-1.8.0-openjdk-javadoc-1.8.0.362.b08-1.el7_9.noarch
# rpm -e --nodeps python-javapackages-3.4.1-11.el7.noarch
# rpm -e --nodeps java-1.8.0-openjdk-javadoc-zip-1.8.0.362.b08-1.el7_9.noarch
重新安装
# yum install -y java-1.8.0-openjdk
已加载插件:fastestmirror, langpacks
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
正在解决依赖关系
# javac -version
-bash: javac: 未找到命令
# java -version
openjdk version "1.8.0_362"
OpenJDK Runtime Environment (build 1.8.0_362-b08)
OpenJDK 64-Bit Server VM (build 25.362-b08, mixed mode)
# yum install java-devel
已加载插件:fastestmirror, langpacks
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Loading mirror speeds from cached hostfile
# javac -version
javac 1.8.0_362
https://i-blog.csdnimg.cn/blog_migrate/44e531604d0f160de8a45f52bd8e61e5.png
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]