Gin and Java > 11

74 views
Skip to first unread message

Gary Ritchie

unread,
Oct 16, 2023, 8:10:23 PM10/16/23
to google-gin
Anybody still here?

Is there anything fundamental in Gin's implementation that makes it impossible for it to work when building GWT applications with jdk17?

We build our gwt 2.10.0-based project code with jdk11 currently, but that's getting long in the tooth and we'd like to bump up to at least 17, but it fails with a variety of problems.

We haven't moved to GIN 3.0.0 (still on GIN 2.1.2 and Guice 3.0). I just discovered this group and that there is a GIN 3.0.0, but I suspect it won't help.

If we're out of luck with GIN / JDK 17, is Dagger2 the thing we might want to consider?

Jens

unread,
Oct 17, 2023, 8:50:46 AM10/17/23
to google-gin
I have split GWT, shared and server code and still compile GWT + shared using JDK 11. Doesn't hurt at all as long as the server code can be updated to newer JDK versions.

Currently I am using GIN 2.1.2 with Guice 6. In the GWT module (*.gwt.xml) I also have <set-configuration-property name="gin.classloading.exceptedPackages" value="com.google.gwt.core.client.impl"/> configured. 

I am relatively sure your issue is Guice 3. For example support for JDK 13 was added in Guice 4.2.3. Try upgrading it to 6.x which has support for JDK 21 and then try again compiling with JDK 17. Also make sure to use --release 11 for GWT code.

While Dagger2 works, it will increase the size of your compiled JavaScript because Dagger2 generates quite a lot of classes. I tried it once in a larger application and the JavaScript output size increased by 1MB. I can't remember the original application size when using GIN but I think it must be somewhere between 8-10MB. For smaller projects Dagger2 should be fine I guess.

-- J.

Gary Ritchie

unread,
Oct 17, 2023, 4:24:51 PM10/17/23
to google-gin
Thanks, I'll give updating Guice a try, that makes sense.

It's a massive GWT codebase, a couple hundred thousand lines of code. So moving to Dagger2 would probably be a non-starter just for the effort required, never mind the increased output size you mentioned!

Oh, and what does --release 11 do? I don't think we've been using that; I'll look it up.

Thanks again. I'll report back what I find with the Guice update.

Gary
Reply all
Reply to author
Forward
0 new messages