Runtime Library Support
GWT supports only a small subset of the classes available in the Java 2
Standard and Enterprise Edition libraries, as these libraries are quite
large and rely on functionality that is unavailable within web
browsers. To find out exactly which classes and methods are supported
for core Java runtime packages, see the API reference for
java.lang
and
java.util
, which lists supported
classes and contains notes on behavioral differences from the standard
Java runtime.
Some specific areas in which GWT emulation differs from the standard
Java runtime:
-
Regular Expressions
-
Serialization
Java serialization
relies on a few mechanisms that are not available in compiled
JavaScript, such as dynamic class loading and reflection. As a result,
GWT does not support standard Java serialization. Instead, GWT has a
RPC facility that provides automatic
object serialization to and from the server for the purpose of invoking
remote methods.
Tip
You'll save yourself a lot of frustration if you make sure that
you use only translable classes in your
client-side code from the very beginning. To
help you identify problems early, your code is checked against the
JRE emulation library whenever you run in
hosted mode. As a result, most uses of
unsupported libraries will be caught the first time you attempt to
run your application. So,
run early and often.