No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

简介: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

目录

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-openjdk

4、参考文章


相关文章
|
Web App开发 Java Apache
【maven】maven的web项目打包报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK
打包过程中报错如下: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK [INFO] Scanning for projects.
4320 0
|
Java Maven Android开发
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
eclipse编译maven项目的时候,保存信息如下: [INFO] Changes detected - recompiling the module! [INFO] Compiling 198 source files to F:\QunL...
2529 0
|
Java Maven Spring
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
一、使用sts (spring tools suite )开发maven项目,再执行run as -> maven install执行错误.错误主要提示: INFO] [INFO] --- maven-compiler-plugin:3.
2236 0
|
Web App开发 Java
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
执行Maven Install打包的时候,出现以下错误信息: [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] No compiler is provided in this environment.
804 0
|
Java Maven
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 使用m2eclipse可能遇到如下错误 [ERROR] Failed to execute goal org.
1396 0
|
13天前
|
Java 应用服务中间件 Linux
Centos7 安装JDK和Tomcat
Centos7 安装JDK和Tomcat
43 0
|
19天前
|
IDE Java Shell
02|手把手教你安装JDK与配置主流IDE
02|手把手教你安装JDK与配置主流IDE
35 0
|
19天前
|
Java Shell 开发者
都2024年了!你还不知道在Docker中安装jdk?
都2024年了!你还不知道在Docker中安装jdk?
|
19天前
|
存储 Cloud Native Java
Anolis安装Jdk保姆级教学
Anolis安装Jdk保姆级教学