Centos使用Maven构建项目失败,
提示No compiler is provided in this environment. Perhaps you are running...
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project 08-heartbeat: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
谷歌翻译显示: 在此环境中不提供编译器。 也许您是在JRE而不是JDK上运行?
yum -y install java-1.8.0-openjdk
查看版本
Javac 命令执行失败
说明我们之前只是安装了jre 没有安装jdk, 所以没有javac工具,百度查找 解决方案后, https://blog.csdn.net/qq_41767116/article/details/113734315
进入根目录,输入yum install -y devel 即可。
重新构建工程
构建成功,问题解决!