我嘗試運行一個專案,但收到此錯誤。電腦是新的mac m1,之前這個專案是在windows上的
RROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project common-core: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR]
[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 debu
uj5u.com熱心網友回復:
在主選單中的Intellij中,轉到此路徑:
檔案 -> 專案結構 -> 平臺設定 -> SDK
要添加新的JDK,請單擊 按鈕并從您的目錄中添加JDK,或者只需下載一個新的。
之后設定專案的 JDK:
檔案 -> 專案結構 -> 專案設定 -> 專案
在此路徑中檢查專案 SDK和專案語言級別部分。
您應該檢查在Intellij中運行的 Maven 的 JDK 的另外兩個重要設定:
第一的:
檔案 -> 設定 -> 專案 -> 構建、執行、部署 -> 構建工具 -> Maven -> 匯入
在此路徑中檢查JDK 中的匯入器部分。
第二:
檔案 -> 設定 -> 專案 -> 構建、執行、部署 -> 構建工具 -> Maven -> Runner
在這里檢查JRE部分。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/464904.html
