How do I upgrade to GWT 1.4?
NOTE: Before upgrading, please see the release notes for details on anything that has changed from 1.3 that may require you to update your client code to work with GWT 1.4.
- Update your GWT library JARs
After downloading and extracting the GWT 1.4 package, update your GWT project classpath by removing the old gwt-user.jar and gwt-dev-<platform>.jar files and adding entries to the new 1.4 versions. If your project uses GWT-RPC, be sure to also update the classpath entry for gwt-servlet.jar to the 1.4 version.
The steps below describe how to update your GWT library JARs using Eclipse, but you could easily adapt these steps to your favorite IDE without much trouble.
- Right-click on your GWT project and select Properties
- From the Properties menu, click on Java Build Path
- In the Java Build Path window, click on the Libraries tab
- From the list of JARs on the project classpath, select each GWT JAR described above and click Remove (alternatively, you can click Edit instead and point each JAR entry to the new GWT JARs in the extracted GWT 1.4 package)
- After removing the old entries, click on Add External JARs
- Browse to the directory where you extracted the GWT 1.4 package
- Select gwt-user.jar and click on OK
- Repeat steps 5 through 7 for gwt-dev-<platform>.jar, as well as gwt-servlet.jar if your project uses GWT-RPC
- Click on OK to accept changes and exit the Properties menu
- Re-build your project with the new JARs (while making sure your project is selected in the Navigator/Package Explorer view, click on Project > Build. In case Eclipse is holding onto cached class files, you may also want to run a clean build by clicking on Project > Clean... > selecting your project and clicking OK)
- (Optional) If you're using shell or compile scripts generated by GWT's applicationCreator, or if you have some Run Configurations defined in your Eclipse project, be sure to update their classpaths to use the new GWT 1.4 JARs as well. This can be done by simply editing the scripts to point the
-classpathjava argument to the new JARs or by updating the classpath in the Classpath tab of the Eclipse Run Configuration menu in a similar fashion as described in the steps above.
- Update to the new 1.4 bootstrap process
By making fewer HTTP requests at startup, the GWT bootstrap process has changed to speed up application loading time. The old GWT 1.3 bootstrap process still works in 1.4, but the new process is way more efficient, so it's worth making the update. Check out the details below that describe how the bootstrap process has changed and what you need to do to update to the 1.4 style.
In GWT 1.3, your application host page needed to include:
<meta>tag describing your module name in the head of your host page
<head> <meta name="gwt:module" content="com.foo.bar.MyModule" /> </head>
- and the gwt.js <script> tag in the body of your host page
In GWT 1.4, all you need to include is the com.foo.bar.MyModule.nocache.js <script> tag in the body of your host page:
Your GWT project should now be updated to GWT 1.4! As a final step, however, you may want to clear your .gwt-cache folder to make sure hosted mode doesn't use any stale 1.3 cached bytecode files. Also, if you're using GWT-RPC, be sure to run a
javaccompile (or have your IDE run a re-compile) over your service classes and point your project and deployed application to the new binaries.