Running GWT 2.4.0 using JDK 17

238 views
Skip to first unread message

Anjana A

unread,
Jan 3, 2024, 9:40:28 AMJan 3
to GWT Users
Hi Team,

Due to some business constraints our application is still running on old GWT.2.4.0 and now we wanted to upgrade java version of our application to JDK 17.  is it possible to run GWT.2.4.0 on an application which uses JDK 17? if yes, can you please guide me with the helpful  resources for the same?

Thanks,
Anjana

Colin Alworth

unread,
Jan 3, 2024, 11:55:25 AMJan 3
to GWT Users
(I wrote a longer reply, but Google Groups ate it and never posted it, so apologies for brevity here):

Without more information, it is hard to give a specific answer - are you just hoping to update the Java version and make no changes to the application? It might be that nothing at all needs to be done. If you're using GWT-RPC, you might have no changes to make at all, or you might need an --add-opens jvm arg for a few specific classes (fix to be released in GWT 2.11).

On the other hand, if you're running the compiler or dev mode on Java 17, other changes are likely needed, due to dependencies that have changed with the Java update.

GWT 2.4.0 was released just over 12 years ago, and was intended to run on Java 6 - even Java 8 will only be ten years old in about two months.

Jim Douglas

unread,
Jan 3, 2024, 3:36:34 PMJan 3
to GWT Users
Apologies for the off-topic question, but is there an estimated timeframe for GWT 2.11?

Colin Alworth

unread,
Jan 3, 2024, 3:40:52 PMJan 3
to GWT Users
Aiming for next week - we hit a release blocker when getting ready to ship it for this week, and once https://github.com/gwtproject/gwt/pull/9888 merges, we will start the release process and smoke testing again. That will take a few days, then we will add the github release and deploy to maven central, as well as update the website with release notes, etc.

You can always use nightly builds from the https://oss.sonatype.org/content/repositories/snapshots/ snapshot repo, with version HEAD-SNAPSHOT. If you're available to help us with an hour or so of smoke tests, we can always use more volunteers (contact me off-list).

Anjana A

unread,
Jan 16, 2024, 7:26:19 AMJan 16
to GWT Users
Hi Colin,

Thanks for the response!
As an initial step I am try to build the GWT SDK jars from source code by following the instructions provided in this link - https://github.com/gwtproject/gwt?tab=readme-ov-file

With few corrections in GWT.2.4.0 source code was able to build jars successfully with JDK 17 and also tried with JDK.1.8 (no code change made) by using command ant clean dist-dev with -Dgwt.tools  from CLI as mentioned in the above link.  But when I use these generated jars(gwt-dev.jar, gwt-user.jar, gwt-servlet.jar, gwt-servlet-deps.jar, requestfactory-apt.jar, requestfactory-client.jar, requestfactory-server.jar, requestfactory-client+src.jar,  requestfactory-server+src.jar, requestfactory-client-src.jar,  requestfactory-server-src.jar) into my application, I am getting below error-

Error trace-

     [java] [1.573s][info][class,load] com.google.gwt.dev.javac.TypeOracleMediator$TypeOracleMediatorResolver source: file:/scratch/home/aarmugam/SDM_java17/sryadava_Ammolite_linux/nnc/core/ACMEConsole/WEB-INF/lib/gwt-dev.jar
     [java] [1.574s][info][class,load] com.google.gwt.dev.javac.CompilationProblemReporter source: file:/scratch/home/aarmugam/SDM_java17/sryadava_Ammolite_linux/nnc/core/ACMEConsole/WEB-INF/lib/gwt-dev.jar
     [java] [1.575s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144000 source: __JVM_LookupDefineClass__
     [java] [1.575s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144400 source: __JVM_LookupDefineClass__
     [java] [1.576s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144800 source: __JVM_LookupDefineClass__
     [java] [1.576s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144c00 source: __JVM_LookupDefineClass__
     [java]    [ERROR] Unable to find type 'java.lang.Object'
     [java] [1.577s][info][class,load] com.google.gwt.dev.util.Messages source: file:/scratch/home/aarmugam/SDM_java17/sryadava_Ammolite_linux/nnc/core/ACMEConsole/WEB-INF/lib/gwt-dev.jar
     [java]       [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')
     [java] [1.578s][info][class,load] java.util.IdentityHashMap$KeyIterator source: shared objects file
     [java] [1.578s][info][class,load] java.io.RandomAccessFile$1 source: shared objects file
     [java] [1.579s][info][class,load] java.util.prefs.FileSystemPreferences$10 source: jrt:/java.prefs
     [java] [1.579s][info][class,load] java.util.prefs.FileSystemPreferences$12 source: jrt:/java.prefs
     [java] [1.579s][info][class,load] java.util.prefs.FileSystemPreferences$11 source: jrt:/java.prefs


I checked many blogs on the similar error where it was mentioned the root cause for this issue was because of classpath mistake.  I am running my application ant build from CLI and also I have verified that all the required jars are present in classpath. Could you please guide me here to tackle this issue? Please note I am  also facing  same issue when I build jars with JDK.1.8 without any code change in GWT.2.4.0 source code.

GWT.2.4.0 source code downloaded from - https://github.com/gwtproject/gwt/releases/tag/2.4.0

Thanks in advance!

Regards,
Anjana 

Colin Alworth

unread,
Jan 16, 2024, 7:47:08 AMJan 16
to GWT Users
Unfortunately, there isn't enough information to help you without redoing the work you've done - most of your log looks like the jvm's own internal logging, which doesn't tell me anything right away at least.

What commands exactly did you use to build, and what changes did you make, how did you validate that the jars you created were able to be used at all, how did you ensure that the changes you made would solve the problems you are after? Can you share the full build log - for certain "Unable to find ..." is not the first line of logging that GWT itself emitted.

In the event you are cherry-picking specific GWT commits since 2.4, to add support for newer JVMs (which is to say changes that are known to add support for newer JDKs), why not simply update to a newer GWT version? Wouldn't it be better to use a version built and tested for what you intend, than to make a custom fork of a 12 year old version?

Quick testing locally shows at least that 2.8.2 will run on Java 17 for the Hello sample app, which is still pretty old, having been published in 2017. In the event you aren't able to update to latest, what about just updating to something not quite as old, but validated to work on Java9+?

Anjana A

unread,
Jan 16, 2024, 8:55:45 AMJan 16
to GWT Users
Colin,

As mentioned earlier due to some unavoidable constraints we are unable to upgrade GWT to its latest version and so we are trying out this option. I have attached the GWT.2.4.0 ant build logs and GWT error related build logs. I am not sure if this gonna work but just wanted to give a try and if it works it will be helpful.  Thank you very much!


Regards,
Anjana

On Tuesday, January 16, 2024 at 6:17:08 PM UTC+5:30 Colin Alworth wrote:
Unfortunately, there isn't enough information to help you without redoing the work you've done - most of your log looks like the jvm's own internal logging, which doesn't tell me anything right away at least.

What commands exactly did you use to build, and what changes did you make, how did you validate that the jars you created were able to be used at all, how did you ensure that the changes you made would solve the problems you are after? Can you share the full build log - for certain "Unable to find ..." is not the first line of logging that GWT itself emitted.

In the event you are cherry-picking specific GWT commits since 2.4, to add support for newer JVMs (which is to say changes that are known to add support for newer JDKs), why not simply update to a newer GWT version? Wouldn't it be better to use a version built and tested for what you intend, than to make a custom fork of a 12 year old version?

Quick testing locally shows at least that 2.8.2 will run on Java 17 for the Hello sample app, which is still pretty old, having been published in 2017. In the event you aren't able to update to latest, what about just updating to something not quite as old, but validated to work on Java9+?

On Tuesday, January 16, 2024 at 6:26:19 AM UTC-6 anjana....@gmail.com wrote:
Hi Colin,

Thanks for the response!
As an initial step I am try to build the GWT SDK jars from source code by following the instructions provided in this link - https://github.com/gwtproject/gwt?tab=readme-ov-file

With few corrections in GWT.2.4.0 source code was able to build jars successfully with JDK 17 and also tried with JDK.1.8 (no code change made) by using command ant clean dist-dev with -Dgwt.tools  from CLI as mentioned in the above link.  But when I use these generated jars(gwt-dev.jar, gwt-user.jar, gwt-servlet.jar, gwt-servlet-deps.jar, requestfactory-apt.jar, requestfactory-client.jar, requestfactory-server.jar, requestfactory-client+src.jar,  requestfactory-server+src.jar, requestfactory-client-src.jar,  requestfactory-server-src.jar) into my application, I am getting below error-

Error trace-

     [java] [1.574s][info][class,load] com.google.gwt.dev.javac.CompilationProblemReporter source:  
    [java] [1.575s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144000 source: __JVM_LookupDefineClass__
     [java] [1.575s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144400 source: __JVM_LookupDefineClass__
     [java] [1.576s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144800 source: __JVM_LookupDefineClass__
     [java] [1.576s][info][class,load] java.lang.invoke.LambdaForm$MH/0x00007fe964144c00 source: __JVM_LookupDefineClass__
     [java]    [ERROR] Unable to find type 'java.lang.Object'
     [java] [1.577s][info][class,load] com.google.gwt.dev.util.Messages source:
     [java]       [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')
     [java] [1.578s][info][class,load] java.util.IdentityHashMap$KeyIterator source: shared objects file
     [java] [1.578s][info][class,load] java.io.RandomAccessFile$1 source: shared objects file
     [java] [1.579s][info][class,load] java.util.prefs.FileSystemPreferences$10 source: jrt:/java.prefs
     [java] [1.579s][info][class,load] java.util.prefs.FileSystemPreferences$12 source: jrt:/java.prefs
     [java] [1.579s][info][class,load] java.util.prefs.FileSystemPreferences$11 source: jrt:/java.prefs

similar_error_log.txt
gwt-source-code-build-log.txt

Colin Alworth

unread,
Jan 16, 2024, 10:30:52 AMJan 16
to GWT Users
Without knowing the specific constraints you're under, and the specific changes you've made, this will be very hard to debug. Feel free to contact me (co...@vertispan.com) off-list if this isn't appropriate to share publicly, and we can see about helping you resolve this by making the changes you need, or helping you to understand what they might entail so you can do it yourself.

The only interesting thing I see in the log so far is that the version of guava in use can't (reflectively, I assume) access some threadlocal details. As of GWT 2.4, the guava version was 6.0, immediately after that release it was updated to 10.0.1. Current GWT uses 19.0. Turn off your JVM logging to reduce the noise a bit.

Understanding the constraints you're under will help to offer a path forward - and the changes you've made so far will clarify what else might need to be done, based on the history of GWT. This is the kind of problem I like solving, but I don't necessarily have a lot of free time to play with it, so a clear picture is important. We know that what you are doing is broadly possible - the limiting factor will be the specific requirements you have to consider it successful.

Jens

unread,
Jan 16, 2024, 11:40:46 AMJan 16
to GWT Users
Hi,

looking at your build logs it seems you have executed

ant clean dist -Dgwt.tools=/home/aarmugam/GWT_Source_code/gwt-2.4.0/tools/ -Dgwt.version=2.4.0
ant clean dist-dev -Dgwt.tools=/home/aarmugam/GWT_Source_code/gwt-2.4.0/tools/ -Dgwt.version=2.4.0

In both cases you have set the system property "gwt.tools" to "gwt-2.4.0/tools". Given the full path it looks a bit unusual so I want to verify that you actually did the correct thing. To build GWT you need to checkout two repositories: https://github.com/gwtproject/gwt and https://github.com/gwtproject/tools. But the system property "gwt.tools" is a bit confusing because the project https://github.com/gwtproject/gwt also has a folder "tools", see https://github.com/gwtproject/gwt/tree/main/tools . The system property  should point to the checked out project https://github.com/gwtproject/tools and not to the subfolder "tools" of the checked out project https://github.com/gwtproject/gwt.

You don't need to set the system property at all, if you checkout both projects next to each other, because by default the GWT build script uses "../tools" as value. So the easiest way is to have a folder layout like

GWT_Source_code
|--- gwt-2.4.0 (checkout of https://github.com/gwtproject/gwt)
     |--- here is also a different tools folder as part of GWT
|--- tools (checkout of https://github.com/gwtproject/tools)

So maybe verify that you have not accidentally mixed up both these tools folders.

-- J.

Reply all
Reply to author
Forward
0 new messages