【已解决】FE的编译报错问题

Viewed 47
  • 我使用master分支代码,在Linux环境下使用maven命令编译FE时报错
  • 下面是我的编译报错信息

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /root/project/doris/fe/fe-common/src/main/java/org/apache/doris/trinoconnector/TrinoConnectorServicesProvider.java:[23,16] cannot access io.trino.Session
bad class file: /root/.m2/repository/io/trino/trino-main/435/trino-main-435.jar(io/trino/Session.class)
class file has wrong version 61.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Doris FE Project Parent POM 1.2-SNAPSHOT:
[INFO]
[INFO] Doris FE Project Parent POM ........................ SUCCESS [ 17.919 s]
[INFO] fe-common .......................................... FAILURE [ 40.101 s]
[INFO] spark-dpp .......................................... SKIPPED
[INFO] fe-core ............................................ SKIPPED
[INFO] hive-udf ........................................... SKIPPED
[INFO] be-java-extensions ................................. SKIPPED
[INFO] java-common ........................................ SKIPPED
[INFO] hudi-scanner ....................................... SKIPPED
[INFO] java-udf ........................................... SKIPPED
[INFO] jdbc-scanner ....................................... SKIPPED
[INFO] paimon-scanner ..................................... SKIPPED
[INFO] max-compute-scanner ................................ SKIPPED
[INFO] avro-scanner ....................................... SKIPPED
[INFO] lakesoul-scanner ................................... SKIPPED
[INFO] preload-extensions ................................. SKIPPED
[INFO] trino-connector-scanner ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:01 min
[INFO] Finished at: 2024-06-05T01:14:36-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project fe-common: Compilation failure
[ERROR] /root/project/doris/fe/fe-common/src/main/java/org/apache/doris/trinoconnector/TrinoConnectorServicesProvider.java:[23,16] cannot access io.trino.Session
[ERROR] bad class file: /root/.m2/repository/io/trino/trino-main/435/trino-main-435.jar(io/trino/Session.class)
[ERROR] class file has wrong version 61.0, should be 52.0
[ERROR] Please remove or make sure it appears in the correct subdirectory of the classpath.
[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 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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :fe-common

1 Answers

编译之前,先执行这个

export JAVA_HOME=/usr/lib/jvm/jdk-17.0.2