Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 911
Khama Avatar asked Nov 07 '22 13:11

Khama


1 Answers

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

like image 136
Tatu Lund Avatar answered Nov 15 '22 05:11

Tatu Lund