到目前为止,我已经使用maven构建了java代码。我正在尝试构建这个使用gradle的项目:https://github.com/opendistro-for-elasticsearch/anomaly-detection
我遵循了以下步骤,它在构建过程中不断失败。
在克隆代码之后,
步骤1:按照链接中提到的步骤,我首先安装了java,并设置了Java home和路径,如下所示
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为什么它会失败?如有任何帮助,我们不胜感激!
谢谢,
哈里
发布于 2020-09-01 04:23:52
您需要将gradle的构建环境设置为使用更新的java版本。您可以使用gradle property org.gradle.java.home设置java版本
org.gradle.java.home=<path to JDK home>https://stackoverflow.com/questions/63677362
复制相似问题