【发布时间】:2020-08-31 19:55:09
【问题描述】:
到目前为止,我已经使用 maven 来构建 java 代码。 我正在尝试构建这个使用 gradle 的项目:https://github.com/opendistro-for-elasticsearch/anomaly-detection
我按照以下步骤操作,但它在构建中不断失败。
克隆代码后,
第 1 步:按照链接中提到的步骤,我首先安装了 java 并设置 Java 主目录和路径,如下所示
yum install java-1.8.0-openjdk
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
export PATH=$JAVA_HOME/bin:$PATH
第 2 步:我尝试使用 gradlew 构建项目,如下所示,结果出现错误,
anomaly-detection]# ./gradlew
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
FAILURE: Build failed with an exception.
* Where:
Build file '/host/eclipse_back/opendistro/anomaly-detection/build.gradle' line: 55
* What went wrong:
A problem occurred evaluating root project 'opendistro-anomaly-detection'.
> Failed to apply plugin [id 'elasticsearch.esplugin']
> Could not create plugin of type 'PluginBuildPlugin'.
> Could not generate a decorated class for type PluginBuildPlugin.
> org/elasticsearch/gradle/plugin/PluginPropertiesExtension has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
为什么会失败?任何帮助表示赞赏!
谢谢,
哈利
【问题讨论】:
标签: gradle build.gradle gradlew