问题
I'm trying to port a Swing application to GWT.
However lots of this application classes use things that are not supported by GWT JRE emulation library such as java.util.Locale, java.text.SimpleDateFormat and much more.
Is there a tool that scans a project and spots such problems?
回答1:
The Google Plugin for Eclipse shows errors for things that are unsupported by GWT's JRE emulation. http://code.google.com/eclipse/
回答2:
The GWT compiler will complain if you try to access classes in the JRE that are not supported.
回答3:
My GWT plugin does not warn until the end of a compilation process.
I fixed this issue by the following way.
In eclipse, Create a java project. Remove JRE from class path. Go to gwt-user.jar. Locate java emulation classes. The path is like that: ..super../emul/java/... Copy them to your java project. What we get So far, your Java project without JRE have java.lan. and etc. classes. This will work except com.google.gwt.lang.Array.java will be missing. I created that array class (you can find it from internet, I couldn't locate it inside jars). Add gwt-user and dev jars to the classpath.
Now, your own library can use only gwt java emulation and other gwt classes. Eclipse will automatically warn you if you access a non emulated Java library.
来源:https://stackoverflow.com/questions/1074876/is-there-a-tool-that-checks-gwt-jre-emulation-library-violations