How to Solve IDEA maven Error:Perhaps you are running on a JRE rather than a JDK

 

Mvncleaninstall-x-dmaven. Test. Skip = true PDEV package error:

Nocompilerisprovidedinthisenvironment.PerhapsyouarerunningonaJREratherthanaJDK?

Idea, project, Maven also set a unified JDK, or report an error.

 

Solution 1:

In Maven’s setting. XML file <profiles> Add the specified JDK version to the tag

<profile>
<id>JDK-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>

Solution 2:

Add the Maven plug-in to the POM. XML file of the project, <plugins> Add JDK path to

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<fork>true</fork>
<executable>
C:\ProgramFiles\Java\jdk1.8.0_181\bin\javac.exe(你的安装路径)
</executable>
</configuration>
</plugin>

Similar Posts: