I am using maven and tycho plug-in to build an eclipse RCP application. I use some java 8 features like lambda expression, but it could not build correctly because of compilation failure.
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project ***.***: Compilation failure: Compilation failure:
[ERROR] .filter(Objects::nonNull)
[ERROR] ^^^^^^^^^^^^^^^^
[ERROR] Method references are allowed only at source level 1.8 or above
[ERROR] 2 problems (2 errors)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
My questions are:
As mentioned in the tycho-compiler-plugin documentation, the information in file .settings/org.eclipse.jdt.core.prefs will be passed to the compiler.
It is necessary then to update the file as follow:
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.source=1.8