若依框架匯入阿里OSS報錯問題解決方案

木子东晓东發表於2024-08-05

[INFO] ruoyi-quartz ....................................... FAILURE [ 0.504 s] [INFO] ruoyi-generator .................................... SKIPPED [INFO] ruoyi-admin ........................................ SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.327 s [INFO] Finished at: 2024-08-05T09:31:18+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ruoyi-quartz: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' -> [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 debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :ruoyi-quartz

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ruoyi-common: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR]

1、首先使用終端檢視java JDK版本號

java -version

輸出結果:

java version "1.8.0_361"

Java(TM) SE Runtime Environment (build 1.8.0_361-b09)

Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)

javac-version

輸出結果:

javac 1.8.0_361

如果
22
大多三方庫不相容,請降級為1.8版本
/usr/libexec/java_home -v your (your = 版本號)

可以這樣配置。統一的寫法

在.bash_profile檔案內

.zshrc這裡面也配置一下

然後

在終端中,執行 source ~/.bash_profile(或相應的配置檔案)來應用更改。

source ~/.zshrc

執行

java -version 和 javac -version

檢視版本是否一致

這樣java 就降級了

相關文章