Java 8 support?

When Java 8 is shipped in March (according to schedule) can I use it for developing Vaadin applications?

Especially I am interested in using the lambda support for getting terse code.



Yes, you might want to take a look at
this blog post

Anyone got Java 8 to work with Vaadin in Eclipse yet?

I tried Kepler SR2 with Java 8 patch, installed and configured Eclipse to use the released JDK 8.
In Eclipse prefs I switched to JDK 8 and source code compliance to Java 8.

I got the missing facet error in Eclipse "
Java compiler level does not match the version of the installed Java project facet"
, but Henri Muurima said it could be ignored.

When trying to run Tomcat (7.0.35) I got an error that it couldn’t be started and in the console window I saw the below stack trace:






at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(

at java.lang.reflect.Constructor.newInstance(

at java.lang.Class.newInstance(



at Method)







at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(

at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(

at org.apache.catalina.util.LifecycleBase.setStateInternal(

at org.apache.catalina.util.LifecycleBase.init(

at org.apache.catalina.startup.Catalina.load(

at org.apache.catalina.startup.Catalina.load(

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

at java.lang.reflect.Method.invoke(

at org.apache.catalina.startup.Bootstrap.load(

at org.apache.catalina.startup.Bootstrap.main(


I think you need WTP support for Java 8 in Eclipse to make this easy: Apparently this was fixed last week and is available in some snapshot build already and should be in the next milestone release, “M7 is scheduled for 2014-05-07”.

Otherwise you need to ensure that you do not have a mismatch between JDK versions used to compile the project and the JDK version used to run Tomcat (just guessing here)

If you are not tied to Eclipse, NetBeans has an amazing, stable, built-in Java 8 support.
Join our webinar
on thursday to see how it performs.


I can’t switch from Eclipse, and since it is my favourite editor I wouldn’t like to either :wink:

I tried the I-build which should have the facet, but I ran in to other problems.
One being weird errors in Eclipse that I needed to implement interface methods, even though they were so called “default” methods.

It seems I need to wait for at least M7 for things to stabilize (which is a petty because the lambdas really make the code much nicer).


I’m using Eclipse Luna EE M6 with (some) updates from latest I-build, and it’s working quite well
in combination with JDK8u20, Tomcat 8.0.5 and Vaadin 7.1.13 (since right now).
As you quoted Henri, there is an error message about the non-matching Java facet, but that’s not
a problem.

Me too had to implement a ‘forEach’ and a ‘spliterator’ method for an extended vaadin UI,
but now i deleted my overwrites, an everything is fine now. Maybe some caching or project cleanup issues…

It’s a shame, that the next milestone is more than a month away, that could have made life
a lot easier, i’m thinking about giving netbeans a new change.



is the link to a reported bug and a link to a patch.
I just installed it, and it seems to work!


Thanks Ralf, I got it to work with Kepler SR2 + Java8 update patch + Java 8 facet patch.



BTW, I love the CTRL+1->“Convert to lambda expression” in Eclipse:

-                UI.getCurrent().access(new Runnable() {
-                    @Override
-                    public void run() {
-                        progress.setValue(0.5f);
-                    }
-                });
+                UI.getCurrent().access(() -> progress.setValue(0.5f));

Old trick for NetBeans users :slight_smile: NetBeans can also suggest to use method references in applicaple places. I’d guess Eclipse will support that at some point too.

Althought IDE’s did pretty good job with inline classes as well, lambdas really made old inline listeners look funny.