Building with Ant in Eclipse - javac not recognizing lambda expression (Java 1.8) -
i trying build existing project using ant in eclipse. problem javac
not recognize use of lambda expression (error: illegal start of expression
) in 1 of files, , build fails during compile
phase of ant.
within eclipse, i've ensured java compiler
compliance level set 1.8 , java 8 in java build path
.
i've ensured path
, java_home
, , jre_home
point java 8 directory (in path
points /bin
directory).
for giggles, compile section of build.xml
file is:
<target name="compile" depends="setup"> <javac destdir="${base}/${build.dir}" srcdir="${base}/${src.dir}" deprecation="true" verbose="false" includeantruntime="false"> <classpath refid="libs" /> </javac> </target>
i'm not sure next. i've resorted restarting eclipse hoping magic happen. suggestions or welcome! in advance.
adding <echo> java version: ${ant.java.version}</echo>
build.xml
revealed ant still running java 1.7.
i added directory location of java 8 javac
, modified javac
task executable
, fork
attributes use it:
<property name="javac1.8" location="/path/to/java8/bin/javac" /> <target name="compile" depends="setup"> <javac executable="{$javac1.8}" fork="yes" destdir="${base}/${build.dir}" srcdir="${base}/${src.dir}" deprecation="true" verbose="false" includeantruntime="false"> <classpath refid="libs" /> </javac> </target>
thanks comments @jim garrison, @wero, , @greg-449. powers combined lead me answer.
Comments
Post a Comment