My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GWT_2_0_RC  
Getting Started with the GWT 2.0 Release Candidates
Updated Nov 25, 2009 by mmendez+personal@google.com

Getting Started with the GWT 2.0 Release Candidates

Before using GWT 2.0 RC2 or RC1, please understand that they are release candidates and will change before the official release. We do not recommend using these release candidate builds for production applications.

This release contains big changes to improve developer productivity, make cross-browser development easier, and produce faster web applications.

Downloading and Installing GWT 2.0 RC SDKs

No installation process is required to use the GWT SDK; simply unzip it into any convenient directory.

Download GWT 2.0 RC2

Download GWT 2.0 RC1

The new debugging support in GWT 2.0, called Development Mode, requires a native browser plugin that will be installed on-demand as you use GWT. See "Getting Started with Development Mode" below for step-by-step instructions for this process.

Downloading and Installing the Google Plugin for Eclipse 1.2 RCs

Google Plugin for Eclipse 1.2 RC1 includes functionality to support the new features in GWT 2.0, so if you're an Eclipse users, we highly recommend installing it as well.

Installation Instructions

Download the Google Plugin for Eclipse 1.2.0 Release Candidate zip distributions for your version of Eclipse:

RC2

RC1

Note: Ensure that your version of Eclipse has Eclipse's Web Standard Tools (WST) installed before installing the plugin. WST can be installed by navigating to the Software Installation section, and selecting the the appropriate WST feature from the update site for your version of Eclipse. The update sites and feature names are provided below.

  • 3.5 (Galileo): Galileo -> Web, XML, and Java EE Development -> Eclipse Web Developer Tools
  • 3.4 (Ganymede): Ganymede Update Site -> Web and Java EE Development -> Web Developer Tools
  • 3.3 (Europa): Europa Discovery Site -> Web and JEE Development -> Web Standard Tools Project

It is strongly recommended that you install the release candidate on a fresh install of Eclipse and use a clean workspace.

Finally, follow these instructions for installing the plugin from a zip distribution.

Important Notes

Terminology changes
We're going to start using the term "development mode" rather than the old term "hosted mode." The term "hosted mode" was sometimes confusing to people, so we'll be using the more descriptive term "development mode" from now on. For similar reasons, we'll be using the term "production mode" rather than "web mode" when referring to compiled script.

Changes to the distribution
Note that there's only one download, and it's no longer platform-specific. You download the same zip file for every development platform. This is made possible by the new plugin approach used to implement development mode (see below). The distribution file does not include the browser plugins themselves; those are downloaded separately the first time you use development mode in a browser that doesn't have the plugin installed.

Major New Features in the GWT SDK

In-Browser Development Mode
Prior to 2.0, GWT hosted mode provided a special-purpose "hosted browser" to debug your GWT code. In 2.0, the web page being debugged is viewed within a regular-old browser. Development mode is supported through the use of a native-code plugin called the "Google Web Toolkit Developer Plugin" for many popular browsers. In other words, you can use development mode directly from Safari, Firefox, IE, and Chrome.

Developer-guided Code Splitting
Code splitting using GWT.runAsync(), along with compile reports (also known as The Story of Your Compile) allows you to chunk your GWT code into multiple fragments for faster startup. Imagine having to download a whole movie before being able to watch it. Well, that's what you have to do with most Ajax apps these days -- download the whole thing before using it. With code splitting, you can arrange to load just the minimum script needed to get the application running and the user interacting, while the rest of the app is downloaded as needed.

Declarative User Interfaces with UiBinder
GWT's UiBinder now allows you to create user interfaces mostly declaratively. Previously, widgets had to be created and assembled programmatically, requiring lots of code. Now, you can use XML to declare your UI, making the code more readable, easier to maintain, and faster to develop. The Mail sample has been updated to show a practical example of using UiBinder.

New Layout Panels for Fast and Predictable Layout
A number of new panels were added, which together form a stable basis for fast and predictable application-level layout. The official doc is still in progress, but for an overview please see Layout Design on the wiki. The new set of panels includes RootLayoutPanel, LayoutPanel, DockLayoutPanel, SplitLayoutPanel, StackLayoutPanel, and TabLayoutPanel.

Bundling of Resources via ClientBundle
GWT introduced ImageBundle in 1.4 to provide automatic spriting of images. ClientBundle generalizes this technique, bringing the power of combining and optimizing resources into one download to things like text files, CSS, and XML. This means fewer network round trips, which in turn can decrease application latency -- especially on mobile applications.

Simplified Unit Testing with HtmlUnit
Using HtmlUnit for running test cases based on GWTTestCase: Prior to 2.0, GWTTestCase relied on SWT and native code versions of actual browsers to run unit tests. As a result, running unit tests required starting an actual browser. As of 2.0, GWTTestCase no longer uses SWT or native code. Instead, it uses HtmlUnit as the built-in browser. Because HtmlUnit is written entirely in the Java language, there is no longer any native code involved in typical test-driven development. Debugging GWT Tests in development mode can be done entirely in a Java debugger.

Major New Features in the Google Plugin for Eclipse

Development Mode Launch View
Integrates your Development Mode logs right into Eclipse, which means one less window to shuffle around

UiBinder Support
The UiBinder template editor provides auto-completion and formatting for editing ui.xml files (and embedded CSS blocks)

Validation of UiBinder templates and backing Java classes

New UiBinder wizard to quickly get started

ClientBundle Support
"New ClientBundle" wizard to bundle CSS and other resources together to minimize HTTP round-trips

As-you-type validation ensures that your app's static resources are always in the right place

RPC Refactoring
Automatically updates sync/async pairs of RPC interfaces and their methods

JNSI Reference Auto-completion
Auto-completion takes the pain out of referencing Java members from JSNI methods

Getting Started with Development Mode

Step 1: Start Development Mode

The first time you launch development mode in GWT 2.0, you might be surprised that not much seems to happen. All you will see is something like this on the console:

 Using a browser with the GWT Developer Plugin, please browse to
 the following URL:
   http://192.168.1.42:8888/Hello.html?gwt.codesvr=192.168.1.42:9997 
(where 192.168.1.42 is your own IP address)
That's because you're now in control over which target browser launches and when.

Step 2: Open a browser

Open the browser you want to use to view the GWT application you're debugging.

If this is the first time you've ever attempt to use development mode with that browser, you will not yet have the GWT Developer Plugin installed, so you'll see a page that instructs you to install the plugin. Once you download and install the plugin, restart the browser and navigate again to the URL from above, making sure it includes the gwt.codesvr query parameter.

When installing the GWT Developer Plugin on Windows 7, certain configurations may require you to explicitly save the installer as a file and then "Run as Administrator".

Note that the first time you access your GWT module from a browser, it may appear to hang momentarily as your module loads. This is normal. Subsequent refreshes within the browser are much faster as long as you keep the development mode session running.

Step 3: Follow the Edit/Save/Refresh cycle without restarting development mode

At this point, use your Java debugger as normal.

Because refeshes are much faster than the initial load, it is strongly recommended that you simply leave development mode running, because you can continue to edit and save any of your projects files -- including .html, .css, .java, .gwt.xml, and .ui.xml files -- and simply refresh to pick up changes.

Step 4: Open additional browsers for testing

You can open any number of additional browsers to ensure your application behaves properly across browsers.

Breaking changes and known issues/bugs/problems

  • Windows users who have previously installed the Google Web Toolkit Developer Plugin for IE will have to uninstall the old version. Use the following steps:
    1. From the Windows "Start" Menu, open "Control Panel"
    2. Select "Add/Remove Programs"
    3. Select "Google Web Toolkit Developer Plugin for IE" then click "Uninstall"
    4. Run Internet Explorer and browse to http://gwt.google.com/samples/MissingPlugin to install the new version of the plugin.
  • The -portHosted Development Mode flag has been renamed to -codeServerPort.
  • The release notes included with RC2 contain one inaccuracy: the Image.onload event still does not fire on Internet Explorer when image is in cache. See issue 863 for more details.
  • Prior to 2.0, GWT tools such as the compiler were provide in a platform-specific jar (that is, with names like gwt-dev-windows.jar). As of 2.0, GWT tools are no longer platform specific and they reside in generically-named gwt-dev.jar. You are quite likely to have to update build scripts to remove the platform-specific suffix, but that's the extent of it.
  • The development mode entry point has changed a few times since GWT 1.0. It was originally called GWTShell, and in GWT 1.6 a replacement entry point called HostedMode was introduced. As of GWT 2.0, to reflect the new "development mode" terminology, the new entry point for development mode is com.google.gwt.dev.DevMode. Sorry to keep changing that on ya, but the good news is that the prior entry point still works. But, to really stay current, we recommend you switch to the new DevMode entry point.
  • Also due to the "development mode" terminology change, the name of the ant build target produced by webAppCreator has changed from hosted to devmode. In other words, to start development mode from the command-line, type ant devmode.
  • HtmlUnit does not attempt to emulate authentic browser layout. Consequently, tests that are sensitive to browser layout are very likely to fail. However, since GWTTestCase supports other methods of running tests, such as Selenium, that do support accurate layout testing, it can still make sense to keep layout-sensitive tests in the same test case as non-layout-sensitive tests. If you want such tests to be ignored by HtmlUnit, simply annotate the test methods with @DoNotRunWith({Platform.HtmlUnit}).
  • Versions of Google Plugin for Eclipse prior to 1.2 will only allow you to add GWT release directories that include a file with a name like gwt-dev-windows.jar. You can fool it by sym linking or copying gwt-dev.jar to the appropriate name.
  • The way arguments are passed to the GWT testing infrastructure has been revamped. There is now a consistent syntax to support arbitrary "run styles", including user-written, with no changes to GWT itself. For example, -selenium FF3 has become -runStyle selenium:FF3. This change likely does not affect typical test invocation scripts, but if you do use -Dgwt.args to pass arguments to GWTTestCase, be aware that you may need to make some changes.
  • When using ClientBundle, be aware that images using alpha transparency do not appear transparent in IE6. The Mail sample application included in the GWT distribution currently suffers from this limitation (that is, the images have opaque backgrounds when viewed on IE6).
Comment by loxal....@gmail.com, Nov 18, 2009

I'm working with SVN builds of GWT prior2.0RC and would recommend you to use Ant for GWT development. Eclipse, its plugins and everything else depends on Eclipse causes just pain in your...

Use Ant if you want to build something beyond a "Hello World!" and "Hello You!" app! Start with the Mail sample as it already uses the declarative UI building mechanism!

Comment by jbrosenb...@gmail.com, Nov 18, 2009

what about maven?

Comment by botbotwi...@gmail.com, Nov 18, 2009

ant and maven? so 1990's. what about my sweet cobol build and dependency management tool called caven?

Comment by merha...@gmail.com, Nov 19, 2009

Is this the correct version of the eclipse plugin? All the JARs say that it is v1.1 Were the version numbers in the zip not changed?

Comment by goudreau...@gmail.com, Nov 19, 2009

Is WST part of the WTP project ?

Comment by kym...@gmail.com, Nov 19, 2009

Ah..One reason I'd like to use GWT is that I'm really not good at CSS/HTML.. But now the new UIBinder seems to be like the old days stuff again.. :)

Comment by federico...@gmail.com, Nov 20, 2009

when i try to launch the application with the plugin i get: "A port must be an integer Google Web Toolkit 2.0.0-ms2 DevMode? [-noserver] [-port port-number | ... ..."

Comment by Tristan....@gmail.com, Nov 20, 2009

What is the DevMode? -server paramater I should pass to get the GAE server running instead of plain old Jetty? I can't find an answer to this anywhere.

Comment by kevin.ji...@gmail.com, Nov 20, 2009

The eclipse plugin doesn't quite work: when creating either ClientBundle or UiBinder, I got the following message: "creation of element failed.

org.eclipse.core.internal.registry.ConfigurationElementHandle? cannot be cast to org.eclipse.jdt.core.compiler.CompilationParticipant?"

I'm using Eclipse 3.4 and I do have Web developer tools installed.

Comment by a.revolu...@gmail.com, Nov 22, 2009

@Tristan... The eclipse plugin SHOULD tell you that you have to add an VM argument similar to:

-javaagent:/home/angelyx/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.2.6.v200910131704/appengine-java-sdk-1.2.6/lib/agent/appengine-agent.jar

where you replace the first bits with dir to your eclipse install.

When I create a project w/ GAE+GWT, and try to make a run configuration without that argument, it tosses up an error field with the uri. Maybe you need a plugin update?

Comment by lunarjchav@gmail.com, Nov 22, 2009

Browser plugins work in Windows 7?

I've tried with:

- IE8. The plugin fails to install. - Firefox. The plugin dont compile properly because it cannot find gxt.jar (im using GXT library) - Chrome. The "missing plugin page" never appears and i only can see the last compiled web.

Comment by a.revolu...@gmail.com, Nov 22, 2009

@lunarjchav - Did you see the part of this wiki that says:

When installing the GWT Developer Plugin on Windows 7, certain configurations may require you to explicitly save the installer as a file and then "Run as Administrator". 

Don't know if that's any help, as it sounds like you're trying to build from source. Have you tried using XP / Vista Compatibility mode? Besides that, all I can recommend would be to use VirtualPC, or install Ubuntu ;-)

Comment by a.revolu...@gmail.com, Nov 22, 2009

GAE + GWT Migration procedure: I had a few little bugs while trying to get my project from 2.0-ms2 to 2.0-rc1. The first was that my old launch configurations wouldn't work; they complained about not recognizing the -style flag. I couldn't circumvent this, so I just worked around it. Please note that I am NOT using a fresh copy of eclipse, as recommended, and I uninstalled the repo copy of the eclipse plugin, before dropping in the 1.2-rc1 copy. Anyway, old run configs = broken.

I used the webAppCreator to make a new project, which spit out a .launch configuration. I opened that, changed over all the values to my current project, and tried running it... Success! ...Almost.

To integrate appengine, include the JVM Argument I mentioned in the post above, -javaagent:/home/angelyx/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.2.6.v200910131704/appengine-java-sdk-1.2.6/lib/agent/appengine-agent.jar !!Replace /home/angelyx with your path to eclipse!! as add the Program Argument: -server com.google.appengine.tools.development.gwt.AppEngineLauncher?

Also, make sure your Working Directory is set to default; old launch configs needed to point to default/war; new method wants the whole project folder. Good luck, and happy hacking!

PS - GWT2.0 rocks!! Thank you!

Comment by lunarjchav@gmail.com, Nov 23, 2009

Thanks a.revolution.ultra.blue, im going to try that you say.

Anyway, i've got to use GWT 2.0 in Firefox. In that case, the problem was in GXT library instead of GWT library. Chrome browser works too, but I had to manually install the plugin (the missing plugin page not appears).

Comment by ron...@gmail.com, Nov 23, 2009

I moved from GWT 1.6 to 2.0 on eclipse 3.4 and installed everything as mentioned above. The compilation goes fine, but when I try to run in the new hosted mode I get the following error on my console:

Unknown argument: -style Google Web Toolkit 2.0.0-rc1 GWTShell [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-portHosted port-number | "auto"] [-remoteUI port-number:client-id-string | host-string:port-number:client-id-string] [-out dir] url?

where

-noserver Prevents the embedded web server from running -port Specifies the TCP port for the embedded web server (defaults to 8888) -whitelist Allows the user to browse URLs that match the specified regexes (comma or space separated) -blacklist Prevents the user browsing URLs that match the specified regexes (comma or space separated) -logdir Logs to a file in the given directory, as well as graphically -logLevel The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL -gen The directory into which generated files will be written for review -portHosted Listens on the specified port for hosted mode connections -remoteUI Sends Development Mode UI event information to the specified host and port. -out The directory to write output files into (defaults to current)
and
url Automatically launches the specified URL

Does anyone know why does it happen and how can I fix it?

Comment by a.revolu...@gmail.com, Nov 23, 2009

YES! You CANNOT use the google g-icon "web app run menu", you need a plain jane java application runner, with main class com.google.gwt.dev.DevMode??

Make sure you have the usual program arguments for a gwt project; mine are: -port 7777 -startupUrl / ai.yx.xSeed

I have / set to a welcome servlet in web.xml, and my gwt project is ai.yx.xSeed

If you want to use appengine, you will also need to add the program arguments and vm arguments I mentioned in the post above. ALSO, if you do NOT use appengine, leave the working directory at default. If you DO use appengine, add /war to whatever your default directory is... My project xBook uses ${workspace_loc:xBook}/war

If you absolutely can't get it to go, just download ms2 from the deprecated dl page, and you can go ahead and use the old google-plugin launch configuration.

Comment by neo.huma...@gmail.com, Nov 23, 2009

Oh ya, I also have a 1.2 release candidate of the google plugin installed. It's mentioned somewhere above, and I deinstalled the old one before dropping the new one in... But it didn't fully uninstall so I'm not really sure. If you still have issues after switching runner types, check this wiki for the rc plugin link.

Comment by key...@gmail.com, Dec 5, 2009

I am experiencing really slow times (30-40 seconds) when I refresh the page on safari or firefox. It almost seems to recompile the full app every single time I hit refresh. I don't even change anything, and this the app you get when you create new Web App in eclipse. Meanwhile the browser hangs like it's supposed to when making a synchronous server request.

Specs: Eclipse 3.5, Mac OS 10.6, Java 6 64-bit (tried with 32-bit 5 and 6), GWT 2.0 RC2 and GPE 1.2 RC2 (tried RC1 for both of those too.

Comment by sco...@google.com, Dec 5, 2009

keyvez: try running with -Dgwt.perflog=true as a JVM arg and see if you can tell where all the time is going. Maybe you're using a misbehaving generator.

Comment by key...@gmail.com, Dec 5, 2009

Hey Scott,

Thanks, here's the information I got from the switch you asked me to try:

perf? OophmSessionHandler?.loadModule Main 838ms

perf? ModuleDef?.refresh 35ms
perf? ResourceOracleImpl?.refresh 1ms perf? ResourceOracleImpl?.refresh 23ms perf? ResourceOracleImpl?.refresh 9ms
perf? TypeOracleMediator?.addNewUnits 165ms perf? ModuleSpace?.onLoad 511ms
perf? Generator 'com.google.gwt.uibinder.rebind.UiBinderGenerator?' produced 'com.company.mypackage.web.client.Application.Binder' 21ms perf? TypeOracleMediator?.addNewUnits 0ms perf? Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator?' produced 'com.company.mypackage.web.client.Application_BinderImpl_GenBundle?' 4ms perf? TypeOracleMediator?.addNewUnits 0ms perf? Generator 'com.google.gwt.i18n.rebind.LocaleInfoGenerator?' produced 'com.google.gwt.i18n.client.impl.LocaleInfoImpl?' 14ms perf? TypeOracleMediator?.addNewUnits 0ms perf? Generator 'com.google.gwt.i18n.rebind.LocalizableGenerator?' produced 'com.google.gwt.i18n.client.impl.CldrImpl?' 0ms

Comment by guyk...@gmail.com, Jan 27, 2010

keyvez : I've been hitting the same problem until I tried changing the url from: http://localhost:8888/HelloGWT.html?gwt.codesvr=10.0.0.3:9997 to http://localhost:8888/HelloGWT.html?gwt.codesvr=localhost:9997 this seems to solve the slowness problem for me.

Comment by sco...@google.com, Jan 27, 2010

Ah yes, that explains it... depending on your network setup, sometimes using your own IP address will actually go over the wire instead of looping back, which can slow things down a bit.


Sign in to add a comment
Powered by Google Project Hosting