E Kh
E Kh

Reputation: 105

Updating Vaadin project's GWT for Java 11

I'm unable to build my maven project with vaadin and gwt components with JDK 11.

I've updated the gwt-user and gwt-dev to latest (2.8.2) version.

I'm using Vaadin7, tried with Vaadin8 also. Try to compile with the vaadin-maven-plugin.

The output of my maven build :

[ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')

I saw related questions but nothing working for me.

Can this stack work with Java 11 ? It works up to Java 8.

EDIT : To compile with JDK11, you'll need gwt-user, gwt-dev and vaadin-maven-plugin to 2.8.2. Then you'll need to upgrade Vaadin to Vaadin 8.9.1.

Upvotes: 5

Views: 1838

Answers (3)

Tatu Lund
Tatu Lund

Reputation: 10633

If you want to setup your Vaadin 8 project to support Java 11 both in server and client side (i.e. GWT) code, you need to patch the project to use GWT 2.9.0.

Vaadin recently published documentation about how to do this in their blog.

Short summary

To upgrade your Vaadin 8 application to use GWT 2.9.0, add the following property:

<vaadin.gwt.version>2.9.0</vaadin.gwt.version>

Then add the dependencies to your pom.xml. If you have a multi-module project, you need to choose the module which defines the widgetset.

<dependency>
    <groupId>com.google.gwt</groupId>
    <artifactId>gwt-dev</artifactId>
    <version>${vaadin.gwt.version}</version>
    <exclusions>
        <exclusion>
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>apache-jsp</artifactId>
        </exclusion>
    </exclusions>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.google.gwt</groupId>
    <artifactId>gwt-user</artifactId>
    <version>${vaadin.gwt.version}</version>
    <scope>provided</scope>
</dependency>

There is one breaking change in GWT 2.9.0, but it is easy to patch it locally. You need to work with the module that contains your client-side code. Add this class to package com.google.gwt.dev.shell:

package com.google.gwt.dev.shell;

public final class CheckForUpdates {
    // NOP
}

Furthermore there is full multimodule proof of concept application in GitHub https://github.com/TatuLund/gwt290-demo

Upvotes: 2

Leif &#197;strand
Leif &#197;strand

Reputation: 8001

Updating the GWT dependencies to 2.8.2 is not enough. You also need to use a version of vaadin-maven-plugin that is based on GWT 2.8.2. I don't remember exactly which version number was the first one that works, but I have personally had errors with Vaadin 8.0 whereas everything has worked for me with Vaadin 8.8.

Upvotes: 1

ollitietavainen
ollitietavainen

Reputation: 4275

GWT 2.8 does not work JDK 11, so the widgetset compilation will not work. You'll need to rely on JDK 8.

Upvotes: -2

Related Questions