简体   繁体   English

如何解决:[javac]此版本的Java不支持经典的编译器;请参见第133页上的“ Java编译器”。 升级到现代

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

Our company recently moved our build environment from our local machine to a docker shell. 我们公司最近将构建环境从本地计算机移至了docker shell。 It caused an old tool that used ant and java to compile to fail. 这导致使用ant和java进行编译的旧工具失败。 I'm not familiar with compiling java so please bear with me. 我对编译Java不熟悉,所以请多多包涵。

We've installed: 我们已经安装了:

  • ant version 1.7.1 ant版本1.7.1
  • java and javac version 1.7.0_141 java和javac版本1.7.0_141

Now the tool compiles but has following error/warning: 现在,该工具可以编译,但是具有以下错误/警告:

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

Would you know what is the cause of this? 您知道这是什么原因吗? Is it a mismatch between ant 1.7.1 vs. the java version? ant 1.7.1与Java版本之间是否不匹配?

I added fork="true" in the ant build .xml file, and the error/warning went away. 我在ant build .xml文件中添加了fork =“ true”,错误/警告消失了。 I don't understand why? 我不明白为什么?

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

通过在build .xml中添加以下内容来解决:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM