gpt4 book ai didi

java - 从源代码构建 Elasticsearch,但它需要 Java 10

转载 作者:行者123 更新时间:2023-11-29 06:50:27 26 4
gpt4 key购买 nike

我正在尝试从源代码构建 Elasticsearch。我从 GitHub repo 克隆而来今天,我按照“Building from Source”下的说明进行操作。

运行 ./gradlew assemble 产生以下错误:

...
> Configure project :benchmarks
=======================================
Elasticsearch Build Hamster says Hello!
=======================================
Gradle Version : 4.7
OS Info : Linux 4.4.0-112-generic (amd64)
JDK Version : Oracle Corporation 1.8.0_161 [Java HotSpot(TM) 64-Bit Server VM 25.161-b12]
JAVA_HOME : /usr/lib/jvm/java-8-oracle
Random Testing Seed : 5554B47DBBCF3CFB
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file '<redacted>/elasticsearch-master/benchmarks/build.gradle' line: 31

* What went wrong:
A problem occurred evaluating project ':benchmarks'.
> Failed to apply plugin [id 'elasticsearch.build']
> the environment variable JAVA_HOME must be set to a JDK installation directory for Java 1.10 but is [/usr/lib/jvm/java-8-oracle] corresponding to [1.8]
...

运行 sudo ./gradlew assemble 会产生不同的错误:

FAILURE: Build failed with an exception.

* Where:
Build file '<redacted>/elasticsearch-master/benchmarks/build.gradle' line: 31

* What went wrong:
A problem occurred evaluating project ':benchmarks'.
> Failed to apply plugin [id 'elasticsearch.build']
> JAVA_HOME must be set to build Elasticsearch

但据我所知,我的 JAVA_HOME 已设置:

$ echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle

$ sudo echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle

$ ls /usr/lib/jvm/java-8-oracle
bin COPYRIGHT db include javafx-src.zip jre lib LICENSE man README.html release src.zip THIRDPARTYLICENSEREADME-JAVAFX.txt THIRDPARTYLICENSEREADME.txt

其他可能有用的信息:

$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

$ gradle -v

------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------

Build time: 2018-04-18 09:09:12 UTC
Revision: b9a962bf70638332300e7f810689cb2febbd4a6c

Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_161 (Oracle Corporation 25.161-b12)
OS: Linux 4.4.0-112-generic amd64

我正在运行 Ubuntu 16.04。

有谁知道如何在不升级到 Java 10 的情况下修复此错误(或者,我如何从源代码构建最新版本的 Elasticsearch)?

最佳答案

当 Elasticsearch says that it only requires Java 8 ,这实际上意味着 Java 8 足以运行 Elasticsearch。 构建 Elasticsearch 完全不同,似乎需要 Java 10(我假设正在使用 Java 10 功能)。因此,如果您想从源代码构建 Elasticsearch,则必须升级到 Java 10。

关于java - 从源代码构建 Elasticsearch,但它需要 Java 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50195428/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com