JAVA_HOME、JAVA 和 ANT 不一致

JAVA_HOME、JAVA 和 ANT 不一致

我已经正确安装 Java。

pc19@-H110:~$  java -version
java version "20.0.2" 2023-07-18
Java(TM) SE Runtime Environment (build 20.0.2+9-78)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)

但是当我通过 ant 脚本运行时,我收到以下错误

pc19@-H110:~/Documents/workspace/DCS$ ant all

We cannot run Java, please ensure you have Java installed.
  We have tried to execute /usr/lib/jvm/jdk-20/bin/java/bin/java but failed.
If you have installed Java in a unusual place you can set JAVA_HOME
to the directory containing the Java installation.

相关内容