I want to use some javax annotation on a GWT app. I download javax.ws.rs-api-2.0.jar here, and then include it in my project (Project/Properties/Java Build Path/Libraries/Add External Jars).
I clean my project, then I refresh my project and build it. But when I launch the Run as button, I got following error:
[ERROR] [gwtinit] - Line 5: The import javax.ws cannot be resolved
Eclipse show me no error in my source file, what did I miss?
Best How To :
With GWT you cannot use all Java libraries available for server side Java. You are restricted to a small JRE emulation subset.
As a consequence you cannot use any librariy using standard Java classes outside of the emulation subset.
Often there are special GWT libraries for the same purpose.
You don't get an error in eclipse because Eclipse interprets your code as standard Java. It doesn't know anything of the GWT restrictions. This is a common pitfall for everbody new to GWT.