For example, JDK 7 is capable of switch(String) rather than just switch(Number/Enum).
If I wrote a GWT client that has switch(String) in its code, will there be any problems?
switch(String) is one of the issues I can think of. Are there compatibility issues beyond switch(String)?
Officially, support is dropped for running the GWT compiler or server-side tooling on Java 7. The GWT distribution is still compiled to run on Java 7 for this release, but no guarantees are made about whether or not this will work. Future versions will compile bytecode for Java 8+.
Language support. GWT supports most of the core Java language syntax and semantics, but there are a few differences you will want to be aware of. GWT 2.8+ supports Java 8 syntax. (Previous versions supported lower Java versions, see the Release Notes for more information.)
It is important to remember that the target language of your GWT application is ultimately JavaScript, so there are some differences between running your application in dev-mode, superdev-mode, and production mode.
GWT is a development toolkit for building and optimizing complex browser-based applications. Its goal is to enable productive development of high-performance web applications without the developer having to be an expert in browser quirks, XMLHttpRequest, and JavaScript.
GWT only officially supports Java 5. It does support a few of Java 6 though, such as allowing @Overrides
on methods implementing an interface method, and String.isEmpty
(though that one is about the runtime emulation, so it's not related to syntax and the compiler).
BTW, GWT uses Eclipse JDT for parsing, and that one hasn't yet been released with support for Java 7 (should come really soon though). Once that's done, GWT would have to be updated to take into account the new "syntax sugar" added by Java 7. When that time come (which probably won't come anytime soon, alas), I bet switch-on-strings will be one of the first supported features, given that JavaScript supports it (so it should be as easy to translate from Java to JS as a switch on an integer).
See also https://groups.google.com/d/topic/google-web-toolkit/dM8D9imIvAI/discussion
As the last answer is from August 2011, here's an update for GWT 2.5: still no support for Java 7, see Release Notes for GWT 2.5 RC2 (no change from RC2 to 2.5 final).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With