(目录) 1、问题描述 在Linux服务上使用maven打包 mvn package 报错 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 2、问题分析 没有配置环境变量 JAVA_HOME 3、问题解
(目录)
1、问题描述
在Linux服务上使用maven打包
mvn package报错
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?2、问题分析
没有配置环境变量 JAVA_HOME
3、问题解决
安装java的时候,只安装了jre,注意需要安装完整jdk
$ yum search jdk java-1.8.0-openjdk.x86_64 : OpenJDK 8 Runtime Environment java-1.8.0-openjdk-devel.x86_64 : OpenJDK 8 Development Environment # 安装完整jdk $ yum install -y java-1.8.0-openjdk-devel配置环境变量,并使其生效
# /etc/profile.d/java.sh # java export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk4、参考文章
- https://stackoverflow.com/questions/19655184/no-compiler-is-provided-in-this-environment-perhaps-you-are-running-on-a-jre-ra