我正在尝试使用多线程编译器来减少构建的持续时间,我发现 eclipse JDT 批处理编译器可以做到这一点。
我们的目标是 1.6,当我切换到 JDT 编译器时,出现此错误:
Compliance level '1.4' is incompatible with target level '1.6'. A compliance level '1.6' or better is required
我正在使用从 http://download.eclipse.org/eclipse/downloads/drops4/R-4.3.2-201402211700 获取的 ecj-4.3.2.jar .
这是我们的 build.xml 的相关部分
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<javac srcdir="${env.BUILDSRC}"
destdir="${env.BUILDBIN}"
includeantruntime="false"
debug="on"
deprecation="no"
target="1.6"
source="1.6"
fork="true"
executable="/opt/java/jdk1.6.0_65_64bit/bin/javac"
memoryInitialSize="1024M"
memoryMaximumSize="2560M"
>
最佳答案
看起来您需要添加一个“compilerarg”元素来指定兼容性级别:
<javac ....>
<compilerarg compiler="org.eclipse.jdt.core.JDTCompilerAdapter" line="-1.6"/>
</javac>
关于java - Eclipse JDT 批处理编译器合规性 1.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24085795/