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.youkuaiyun.com/qq_41767116/article/details/113734315
进入根目录,输入yum install -y devel 即可。

重新构建工程


构建成功,问题解决!

Centos使用Maven构建项目失败,提示环境中无编译器,可能运行在JRE而非JDK上。经检查发现之前只装了jre没装jdk,缺少javac工具。通过在根目录输入yum install -y devel解决问题,重新构建工程成功。
3811

被折叠的 条评论
为什么被折叠?



