Re: Building a GWT project in Eclipse 2019-03+ with Java 11.

2022-02-18 Thread tekkyru
Hi Jasper

I'll be just glad if my current progress saves someone's time.
I progress on step by step basis, so far I succeeded in Eclipse build and 
debugging.

Most of my problems were caused by combination of JDK11+ (namely modules) + 
Gradle + Eclipse + Eclipse GWT Plugin. 

Reason: GWT SDK gwt-dev.jar contains lot of classes that must not be 
visible to Eclipse compiler, but in fact they are, causing dreaded "The 
package org.w3c.dom is accessible from more than one module: , 
java.xml" error.
When `gradle build` is issued in command line the gwt-dev.jar from the 
maven repository is linked, it contains exactly essential google classes 
and nothing more. Thus the build succeeds.

But when you import such project in Eclipse under JDK11+ (I use JDK17) and 
select a GWT SDK there're lots of build errors caused by "The package is 
accessible from more than one module"

Reason: To run devmode or compilation server in Eclipse via Eclipse GWT 
plugin, you need full-blown gwt-dev.jar, so you need to install a GWT SDK 
and select it in your Eclipse project. And for some reason (by design of 
the Eclipse GWT plugin) this gwt-dev.jar from SDK spoils the Eclipse 
compilation classpath even if the build.gradle adds a dependency to the 
"essential" gwt-dev.jar

Indeed the Eclipse GWT Plugin allows to use an "essential" gwt-dev.jar from 
project dependencies instead of a real GWT SDK (even without installing it 
and registering in Eclipse), but *only for Maven projects*. Gradle is not 
covered. 

My solution was to patch an existing GWT SDK:

1. prepare GWT SDK 
assuming we have it installed into gwt-2.9.0 folder:
  mv gwt-2.9.0 gwt-2.9.0-jdk11
  cd gwt-2.9.0-jdk11

rename full blown gwt-dev 
  mv gwt-dev.jar gwt-dev-rundevserver-full.jar

 then assuming we already have dependencies stored in cache let's get the 
"essential" jar 
  cp ~/.m2/repository/com/google/gwt/gwt-dev/2.9.0/gwt-dev-2.9.0.jar 
gwt-dev.jar
 it will leak to Eclipse build classpath but it's jdk11-conformant (or 
rather Jigsaw conformant)

2. add the patched GWT SDK (its folder name *gwt-2.9.0-jdk11* is used as 
its name) to Eclipse project via maven, so it will be already bound after 
project import
  
  eclipse.classpath {
containers 
"com.gwtplugins.gwt.eclipse.core.GWT_CONTAINER/gwt-2.9.0-jdk11"
  }

3. Fix compilation server launcher

Let's refer the full-blown jar in launcher started by GWT Plugin:

Add a web server to eclipse (Tomcat or another one), 
add your webapp to the server (at this moment I usually set server start 
timeout to really long interval and uncheck the webapp "autoreloading 
enabled" to avoid webapp relaunch on hot code replace), 
then click "debug server" button:
  -> compilation server launcher config will be created, your webapp and 
the compilation server will launch but the latter will fail because the 
gwt-2.9.0-jdk11/gwt-dev.jar only contains skeleton files 
 
Stop the webapp
Edit the compilation server configuration: 
Edit classpath adding GWT_SDK_HOME/gwt-dev-rundevserver-full.jar as 
external jar to the [User entries] as the last entry:

[image: image_2022-02-19_013438.png]
 
"Debug server" once more: the compilation server must start and work now. 
The debugger and hot code replace for server classes will work as they 
should, and the changes to client java GWT files will be promptly 
recompiled when you refresh the page. It works in web server of your 
choice, not in Jetty bundled with GWT SDK. 
And click-through / debugging into XML/Servlet classes no more opens java 
bytecode in fullblown gwt-dev.jar but proper source files of JDK or your 
dependencies.

Hope this helps

Tequilacat

среда, 16 февраля 2022 г. в 06:12:23 UTC+1, blackh...@gmail.com: 

> Hi ,
>
> You mention that you are migrating from jdk 1.8 to jdk 17.
> We are in the same process, any tips you have?
>
> regards,
>
> Jasper
>
> Op dinsdag 15 februari 2022 om 22:30:30 UTC+1 schreef tequil...@gmail.com:
>
>> Hi, 
>>
>> > You're all set; the plugin will use the GWT dependencies from the Maven 
>> project.
>>
>> The question - can I configure it with gradle?
>>
>> I'm porting a GWT gradle-based Eclipse project from JDK 1.8 to JDK 17 
>> (and from 2.8.2 to 2.9.0)
>> In Eclipse, there's typical JDK11+ error "The package org.xml.sax.helpers 
>> is accessible from more than one module" and it looks like the org.xml.sax 
>> classes shipped in gwt-dev.jar clash with jdk. Eclipse compiler somehow 
>> refers gwt-dev.jar. 
>> Command line gradle build succeeds OK.
>> If maven-central version of gwt-dev doesn't contain duplicating classes 
>> it would save the day. 
>>
>> Is there a way to configure *gradle* project to force Eclipse plugin to 
>> use GWT version from gradle dependencies?
>>
>> I have GWT 2.9.0 installed and added in Eclipse. To avoid referring this 
>> all-inclusive gwt-dev I removed GWT-2.9.0 from list of GWT SDKs in Eclipse 
>> settings, and now after importing/refreshing my gradle project the GWT 
>> plugin SDK selection doesn't 

GWT and UserAgent

2022-02-18 Thread David Nouls
Hello I read that FireFox and Chrome are deprecating the useragent string.
Is GWT depending on this and will it be impacted ?

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/6506bc9c-8d6d-49a9-ad2c-e7530a3a7f7cn%40googlegroups.com.