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.

一、使用sts (spring tools suite )开发maven项目,再执行run as -> maven install执行错误.错误主要提示:

INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-boot-admin ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Users\Administrator\git\spring-boot-admin\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.811 s
[INFO] Finished at: 2015-10-14T09:42:08+08:00
[INFO] Final Memory: 13M/204M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project spring-boot-admin: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

注意
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

这是因为sts安装默认是选择jre来运行程序的,而maven的的一些功能要求使用JDK。解决方法是配置sts的jre,修改成jdk。



修改后看起来是这样:



最后选中你当前项目  右键该项目 -> Maven -> Update Project





目录
相关文章
|
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?
151 0
|
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.
4314 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...
2517 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.
1391 0
|
2月前
|
Java 应用服务中间件 开发工具
最简单JDK安装指南(小白也能一次性安装完成)
最简单JDK安装指南(小白也能一次性安装完成)
|
3月前
|
Java
安装JAVA_JDK快速入门
安装JAVA_JDK快速入门
|
1天前
|
关系型数据库 MySQL Java
Linux 安装 JDK、MySQL、Tomcat(图文并茂)
Linux 安装 JDK、MySQL、Tomcat(图文并茂)
12 2
|
9天前
|
Oracle Java 关系型数据库
Java 开发者必备:JDK 版本详解与选择策略(含安装与验证)
Oracle Java SE 支持路线图显示,JDK 8(LTS)支持至2030年,非LTS版本如9-11每6个月发布且支持有限。JDK 11(LTS)支持至2032年,而JDK 17及以上版本现在提供免费商用许可。LTS版本提供长达8年的支持,每2年发布一次。Oracle JDK与OpenJDK有多个社区和公司构建版本,如Adoptium、Amazon Corretto和Azul Zulu,它们在许可证、商业支持和更新方面有所不同。个人选择JDK时,可考虑稳定性、LTS、第三方兼容性和提供商支持。
24 0