Does GWT (Google Web Toolkit) support Java 7 constructs?

17 Sep

The short answer is: No, as of version 2.5.1. If you’re building web applications with GWT and try to use Java 7 constructs, be careful. A few days ago I was bitten by a nasty surprise when I tried to write use Strings in a switch statement, for demonstration purposes please see the code below that I have adapted from the Hello World example of GWT in Action:

The code above compiles perfectly fine with the latest version of GWT, Eclipse and Java 7, but if you try to run in using the Development Mode, instead of the expected output in your web browser window, you will get run-time error in Eclipse:

21:17:33.280 [ERROR] [com.manning.gwtia.ch02.HelloWorld] Line 16: 
Cannot switch on a value of type String. Only convertible int 
values or enum constants are permitted

as an indication that you are still in Java 6 world when it comes to the language constructs you can use in GWT.

The situation is not hopeless, at least for people who can wait because it seems like support for Java 7 will soon appear in GWT, though I could not find the exact date when it will be. The following links include more information about recent GWT developments:


Posted by on September 17, 2013 in java, Programlama


Tags: , , , , , , ,

2 responses to “Does GWT (Google Web Toolkit) support Java 7 constructs?

  1. Erdem

    September 18, 2013 at 11:06

    Merhaba, bu konu ile alakasi yok, ama “Turkish Deasciifier” yeni Firefox (v24) ile calismiyor. Zamaniniz oldugunda ilgilenirseniz sevinirim, tesekkürler!

  2. Maxim Dominichenko

    March 6, 2014 at 17:19

    I’d recommend simply do not use Development mode at all, because (a) it is deprecated in GWT, and (2) Super Development Mode works fine with GWT and Java 7.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: