maven安装时出现编译错误我该如何解决这个错误[重复]
Posted
技术标签:
【中文标题】maven安装时出现编译错误我该如何解决这个错误[重复]【英文标题】:compilation error while maven install how can i solve this error [duplicate] 【发布时间】:2019-12-01 10:24:26 【问题描述】:我的 pom 是
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.o7planning</groupId>
<artifactId>springBootSecurityJPA-1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springBootSecurityJPA-1</name>
<description>Spring Boot+Spring Security+JPA+Rmember Me</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
控制台是
编译错误:[信息] -------------------------------------------------- ------------ [错误] 此环境中未提供编译器。也许你正在跑步 在 JRE 而不是 JDK 上? [错误] 未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 项目springBootSecurityJPA-1上的(默认编译):编译 失败
【问题讨论】:
什么错误?在此处包含错误文本.. 【参考方案1】:错误提示您使用的是 JRE 而不是 JDK。检查您的 JAVA_HOME 变量。
https://www.baeldung.com/maven-java-home-jdk-jre
【讨论】:
以上是关于maven安装时出现编译错误我该如何解决这个错误[重复]的主要内容,如果未能解决你的问题,请参考以下文章