解决方法:[javac]本版本java不支持经典编译器;升级到现代

How to resolve: [javac] This version of java does not support the classic compiler; upgrading to modern

我们公司最近将我们的构建环境从我们的本地机器转移到了 docker shell。它导致一个使用 ant 和 java 的旧工具编译失败。我不熟悉编译java所以请多多包涵

我们已经安装:

现在该工具可以编译但具有以下内容 error/warning:

[javac] This version of java does not support the classic compiler; upgrading to modern

请问这是什么原因造成的? ant 1.7.1 与 java 版本不匹配吗?

我在 ant build .xml 文件中添加了 fork="true",error/warning 消失了。我不明白为什么?

<javac destdir="classes"
       debug="on"
       includeantruntime="false"
       fork="true" >                 // <-- Somehow fork="true" got rid of warning/error.

通过在构建中添加这个解决。xml:

<property name="build.compiler" value="modern" />