我正在尝试使用多线程编译器来减少构建的持续时间,我发现eclipse JDT Batch Compiler就是这样做的。
我们的目标是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"
>
答案 0 :(得分:2)
看起来您需要添加'compilerarg'元素来指定兼容级别:
<javac ....>
<compilerarg compiler="org.eclipse.jdt.core.JDTCompilerAdapter" line="-1.6"/>
</javac>