apt
每当我尝试在 Mac 上运行任何命令时,我都会得到
Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home/bin/apt" (-1)
错误。
我的.bash_profile
样子如下:
Export JAVA_HOME=/Library/Java/Home
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
答案1
尝试设置JAVA_HOME
为:
/Library/Java/JavaVirtualMachines
如果没有帮助,请尝试将 JAVA_HOME 设置为此命令输出:
/usr/libexec/java_home
答案2
从 Java 8 开始,apt 工具显然已被删除。请参阅以下位置的附加说明:https://stackoverflow.com/questions/61847716/unable-to-locate-an-executable-at-library-java-javavirtualmachines