centos7编译zookeeper报错:Unable to find a javac compiler...解决

centos7编译zookeeper报错:Unable to find a javac compiler...解决,第1张

centos7编译zookeeper报错:Unable to find a javac compiler...解决 问题:

在centos7中使用ant编译zookeeper时报错:

/usr/local/apache-zookeeper-3.5.9/build.xml:328: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b03-1.el7.x86_64/jre"
 

原因:

经排查,原因为未安装jdk开发环境

解决方法,重装jdk及开发包: 1.卸载已安装的openjdk

查看已安装jdk:rpm -qa | grep openjdk 

卸载已安装jdk:rpm -qa | grep openjdk | xargs rpm -e --nodeps

查看是否已卸载:

 

2.重装jdk

安装:yum install java-1.8.0-openjdk
配置环境变量:vim /etc/profile

文件尾追加以下代码:

 配置文件生效:source /etc/profile

3.安装jdk开发环境

yum install java-1.8.0-openjdk-devel.x86_64

查看安装目录内容如下

 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5624379.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存