I tried to build ant-core-1.7.0 with ecj today. Gentoo uses a "custom" build.xml that uses source=1.2 as parameter for ant. Ecj rejects this source level with the message: build-core: Compiling 50 source files to /var/tmp/portage/dev-java/ant-core-1.7.0/work/apache-ant-1.7.0/build/classes source level should be comprised in between '1.3' and '1.6' (or '5', '5.0', ..., '7' or '7.0'): 1.2 It would be good to use source=1.3 in this case. Reproducible: Always Steps to Reproduce:
I thought the ant-core ebuild built it always with javac?
Using gcj to build ant-core it's build with ecj first.
I'm seeing the same issue. At the end of the build, the following is emitted: !!! When you file a bug report, please include the following information: GENTOO_VM=gcj-jdk-4.3 CLASSPATH="." JAVA_HOME="/usr/lib/gcj-4.3.0_alpha20070921" JAVACFLAGS="-source 1.4 -target 1.4" COMPILER="" and of course, the output of emerge --info The interesting part is the JAVACFLAGS="source 1.4 -target 1.4" Looking at the eclasses, I'm thinking that java-pkg_get-source and java-pkg_get-target are being set to 1.4. I did not see where javac.source and javac.target properties are being rewritten in the build.xml. I tried overriding JAVA_PKG_WANT_SOURCE. The original error didn't change (but the JAVACFLAGS did reflect the new value).
Some relevant lines from /var/tmp/portage/dev-java/ant-core-1.7.0/work/apache-ant-1.7.0/build.xml: ... <project name="apache-ant" default="main" basedir="."> ... <!-- =================================================================== Set the properties that control various build options =================================================================== --> ... <property name="javac.target" value="1.2"/> <property name="javac.source" value="1.2"/> ...
Created attachment 134543 [details, diff] Patches build.xml to use 1.3, not 1.2
Created attachment 134544 [details] Ebuild using ecj.patch
The patch I just uploaded modifies the relevant lines in build.xml that cause ecj to fail.
Or you add 'java-ant_bsfix_one build.xml' at the end of src_unpack(). But please fix this annoying problem, thanks! :)
Adding sed -i 's#1\.2#1.3#' build.xml to the end of src_unpack also solves this. Why is this being built with such an old bytecode version in the first place?
(In reply to comment #8) > Or you add 'java-ant_bsfix_one build.xml' at the end of src_unpack(). > But please fix this annoying problem, thanks! :) That's the right way :) Fixed in CVS in ant-core-1.7.1-r1, thanks!