我有一臺配備M1處理器的全新 Macbook Air
按照官方指南https://www.elastic.co/guide/en/elasticsearch/reference/current/brew.html我嘗試安裝elasticsearch 7:
brew tap elastic/tap
brew install elastic/tap/elasticsearch-full
一旦我嘗試使用它啟動它,$ elasticsearch我就會收到此錯誤:
/opt/homebrew/Cellar/elasticsearch-full/7.16.2/libexec/bin/elasticsearch-env: line 83: /opt/homebrew/Cellar/elasticsearch-full/7.16.2/libexec/jdk.app/Contents/Home/bin/java: Bad CPU type in executable
如果我嘗試使用brew services start elastic/tap/elasticsearch-full它啟動服務將失敗,并且我會在日志檔案中收到相同的錯誤/opt/homebrew/var/log/elasticsearch.log
/opt/homebrew/Cellar/elasticsearch-full/7.16.2/libexec/bin/elasticsearch-env: line 83: /opt/homebrew/Cellar/elasticsearch-full/7.16.2/libexec/jdk.app/Contents/Home/bin/java: Bad CPU type in executable
打開elasticsearch-env導致問題的檔案 ( ) 后,第 83 行顯示:
# check the Java version
"$JAVA" "$XSHARE" -cp "$ES_CLASSPATH" org.elasticsearch.tools.java_version_checker.JavaVersionChecker
如果我嘗試執行
/opt/homebrew/Cellar/elasticsearch-full/7.16.2/libexec/jdk.app/Contents/Home/bin/java
我收到錯誤
Bad CPU type in executable
因此,在 elasticsearch-full brew 安裝期間似乎安裝了一個糟糕的 Java 架構(也許不是 M1,而是 x84 或其他什么?)。這是幾個小時前購買的全新 Macbook。Elasticsearch 是我嘗試在其上進行 brew install 的第一件事(因此之前沒有安裝 Java 應用程式)
有人知道如何解決這個問題嗎?
uj5u.com熱心網友回復:
好的,問題是我需要單獨安裝 Java JDK。
我剛剛安裝了Java OSX ARM DMG,然后 ES 正在作業
只要$ java -version不給你拋出錯誤這個錯誤就不會出現
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/394515.html
