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