Monday, December 29, 2014

Re: Adding external jars to eclipse GWT projects

Are you trying to use Gson in client-side code? That will not work. (see http://www.gwtproject.org/doc/latest/DevGuideCodingBasics.html)

GWT includes the package com.google.gwt.json.client for client-side JSON. You can use Gson or another JSON package on the server-side (I use json.org).

On Thursday, December 25, 2014 6:09:10 PM UTC-5, Taher Abouzeid wrote:
I want to use the gson jar to encode and decode data in json. i put it in the war/WEB-INF/lib directory and used it in the code but eclipse couldn't find it in order to be able to work with it until i added it to the build path for the project. but after i do the gwt compile and start the server and send a request, i get the following error

WARNING: Error for /functionlibrary/functionlibrary

java.lang.Error: Unresolved compilation problems: 

Gson cannot be resolved to a type

GsonBuilder cannot be resolved to a type


i have searched online in countless forum posts and none of them work... i'm using gson jar exclusively on the server side, and when i try to use the one in the repackaged package that comes with gwt i get an error saying that it's unreliable. i'd like someone to give me precise instructions on how to add any jar i like to the server side code to work with.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment