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.
4315 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...
2520 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.
2230 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.
799 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.
1392 0
|
2天前
|
弹性计算 运维 Java
一键安装二进制JDK
【4月更文挑战第30天】
6 0
|
2天前
|
关系型数据库 MySQL 应用服务中间件
centos7在线安装jdk1.8+tomcat+mysql8+nginx+docker
现在,你已经成功在CentOS 7上安装了JDK 1.8、Tomcat、MySQL 8、Nginx和Docker。你可以根据需要配置和使用这些服务。请注意,安装和配置这些服务的详细设置取决于你的具体需求。
17 2
|
4天前
|
Java Windows
java——安装JDK及配置解决常见问题
java——安装JDK及配置解决常见问题
|
6天前
|
关系型数据库 MySQL Java
Linux 安装 JDK、MySQL、Tomcat(图文并茂)
Linux 安装 JDK、MySQL、Tomcat(图文并茂)
28 2