Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT compatibility with JDK 7 new features

Tags:

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)?

like image 856
Blessed Geek Avatar asked Aug 26 '11 15:08

Blessed Geek


People also ask

Is GWT still supported?

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+.

Does GWT support 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.)

Which language do you use to program in GWT?

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.

What is purpose of GWT?

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.


2 Answers

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

like image 96
Thomas Broyer Avatar answered Sep 20 '22 09:09

Thomas Broyer


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).

like image 38
jfrantzius Avatar answered Sep 21 '22 09:09

jfrantzius