No compiler is provided in this environment. Perhaps you are running on a JRE

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

错误如下

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project teavm-metaprogramming-api: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

 这是因为运行的是JRE,而不是JDK


解决办法

vi .bashrc
export JAVA_HOME=${HOME}/tsjdk8
export PATH=${JAVA_HOME}/bin:${PATH}

查看

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/uos/apache-maven-3.6.3
Java version: 1.8.0-taishan, vendor: AdoptOpenJdk, runtime: /home/tsit/tsjdk8-uos-64/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "4.19.0-6-amd64", arch: "amd64", family: "unix"

现在是在JDK的JRE上,就对了。

目录
相关文章
|
3月前
|
Java
No compiler detected, make sure you are running on top of a JDK instead of a JRE
No compiler detected, make sure you are running on top of a JDK instead of a JRE
50 1
|
5月前
|
Java Maven
【已解决】MAC安装maven,The JAVA_HOME environment variable is not defined correctly, this environment
【已解决】MAC安装maven,The JAVA_HOME environment variable is not defined correctly, this environment
324 0
|
Java 应用服务中间件
解决启动tomcat出现的The JRE_HOME environment variable is not defined correctly问题~
解决启动tomcat出现的The JRE_HOME environment variable is not defined correctly问题~
341 0
|
Java Maven
Maven配置报错The JAVA_HOME environment variable is not defined correctly
Maven配置报错The JAVA_HOME environment variable is not defined correctly
228 1
|
Java 应用服务中间件
Tomcat出现the jre_home environment variable is not defined correctly this environment variable is need
今天运行Tomcat点击startup.bat cmd直接一闪而过,直接闪退了,很难受,原因是前几天手贱不小心把环境全删了,好难受,只能重新安装了,现在官网下载jdk,我的是jdk-17.0.2,路径是`D:\javase\jdk-17.0.2` 记住这个路径(很重要),然后在环境变量里设置,在用户变量里添加JAVA_HOME与JRE_HOME把我们刚刚的路径复制进去。在系统变量里面的PATH新建的添加%JAVA_HOME%\bin 与%JRE_HOME%\bin 点击确定。环境配置好了。
670 0
Tomcat出现the jre_home environment variable is not defined correctly this environment variable is need
|
Java Maven
Maven报错 Error running ‘ [install]‘:No valid Maven installation found.maven不能用
Maven报错 Error running ‘ [install]‘:No valid Maven installation found.maven不能用
869 0
|
Java Scala
sbt.internal.inc.CompileFailed: Error compiling the sbt component ‘compiler-interface-2.11.8-61.0‘
IDEA 的 JDK 和 Scala 版本对应不上。 使用 Scala12.1.8配上 JDK8
486 0
|
Java Linux 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?
192 0
|
应用服务中间件
The JRE_HOME environment variable is not defined correctly This environment【tomcat闪退】
The JRE_HOME environment variable is not defined correctly This environment【tomcat闪退】
108 0
The JRE_HOME environment variable is not defined correctly This environment【tomcat闪退】
|
应用服务中间件
tomcat闪退[【the jre_home environment variable is not defined correctly this environment variabl】
tomcat闪退[【the jre_home environment variable is not defined correctly this environment variabl】
150 0
tomcat闪退[【the jre_home environment variable is not defined correctly this environment variabl】