mvn“No compiler is provided in this environment”报错解决方案



整理自 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
我没用Eclipse,故说明以下两种方法,其中,使用方法二(在此之前使用了方法一)后问题已解决。

方法一:设置环境变量JAVA_HOME的值

如图所示

方法二:更新pom.xml文件的值

设置fork为true且说明JDK的路径

<build>
...
    <plugins>
    ...
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <fork>true</fork>
                <executable>C:\Program Files\Java\jdk1.8.0_45\bin\javac.exe</executable>
            </configuration>
        </plugin>
    </plugins>
</build>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM