Java 8 Client Compile with Lambda

I get the following compile error:
“Lambda expressions are allowed only at source level 1.8 or above”

After searching for it, i had to set the sourceLevel to 1.8
I did not find a way to set this.
Or do i miss something?

I use Vaadin 7.4.6 with all maven compile plugins

Could you elaborate a bit? Are you using Eclipse? Check the Java Build Path/Java Compiler for your project (right-click project > Properties).

I Use maven to build.
Maven Compiler is set to target/source 1.8

the vaadin-maven-plugin during compile of the client code is throwing this exception.
snipped from maven vaadin plugin is:


<plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <configuration>
          <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
          <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This way compatible with Vaadin eclipse plugin. -->
          <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
          <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
          <!-- Most Vaadin apps don't need this stuff, guide that to target -->
          <persistentunitcachedir>${project.build.directory}</persistentunitcachedir>
          <deploy>${project.build.directory}/gwt-deploy</deploy>
          <!-- Compile report is not typically needed either, saves hunreds of mb disk -->
          <compileReport>false</compileReport>
          <noServer>true</noServer>
          <!-- Remove draftCompile when project is ready -->
          <draftCompile>false</draftCompile>
          <style>OBF</style>
          <strict>true</strict>
          <runTarget>http://localhost:8080/app</runTarget>
        </configuration>
      </plugin>

Hi Renier,

Unfortunately I think the current GWT compiler version does not support Java 8, so you can’t use its features when writing client-side code :frowning:

I know this is an old thread, but the issue still persists so maybe others could benefit from my findings.

Vaadin-client in version 7.7.6 depends on GWT 2.7 (2.7.0.vaadin4 actually) which does not support Java 8 but GWT 2.8 already does. Vaadin 8 will depend on GWT 2.8, but until it is released we can still tweak 7.7.6 to use GWT 2.8 on our own risk as written in
this article
.