无法在 Mac OS 终端上找到 jdk9

Unable to locate jdk9 on Mac OS Terminal

我正在尝试使用此命令安装 ConceptNet 库:

sudo apt install build-essential python3-pip python3-dev libhdf5-dev libmecab-dev mecab-ipadic-utf8

这是我得到的输出:

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/apt" (-1)

我尝试找到 "apt" 文件位置,但它不在下图所示的文件夹中:

我该如何解决这个问题?

扩展 Alan 以及评论中指出的细节

JSR 269: Pluggable Annotation Processing API descibes about the implementation of APIs in JDK to propose the removal of the apt tool as also proposed in JEP 117: Remove the Annotation-Processing Tool (apt)

The apt annotation processing framework is JDK-specific and dates back to JDK 5. The functionality of the API was standardized with JSR 269, which shipped as part of Java SE 6. In JDK 7, the entirety of the apt API was deprecated.

JDK8 b27 的发布将此标记为已解决,此后 apt 不再是 JDK 的一部分。

并且 compatibility guide over feature removals 进一步详细说明了这一点 -

Use the options available in the javac tool and the APIs contained in the packages javax.annotation.processing and javax.lang.model to process annotations.


要使用apt,您可以使用Brew, MacPorts等软件,这些软件提供了与它们打包的apt。然后你可以使用类似的命令,如 brew install ...