Java 8 support in GWT

EDIT GWT 2.8.0 was released on Oct 20, 2016 with support for Java 8 language constructs (lambdas, method references) and emulation of some Java 8 APIs (streams mostly)

EDIT as of Apr 2014, GWT 2.6 supports Java 7, and work is underway to support Java 8 in GWT 2.7, to be released by the summer 2014. GWT 2.7 is likely to only support Java 8 language constructs though, and not emulate any new API (streams, javax.time, etc.)


The plan is to first support Java 7: https://github.com/gwtproject/gwt/labels/java7

This involves updating JDT, and this is being worked on (or alternatively, switch to something else entirely; JetBrains proposed using their parser which already supports Java 8, but GWT also needs a compiler and I don’t know what they provide exactly). The next steps are to map new language constructs to JavaScript (strings-in-switch come to mind, as they could directly map to JavaScript without the hashCode-based desugaring that a Java compiler would be doing).

As long as GWT uses JDT for its Java parsing/munging/compiling, Java 8 can only be supported when JDT will support it (at an acceptable level, which is not yet the case AFAICT).

Leave a Comment