How to add a java library to client-side code?

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

How to add a java library to client-side code?

Postby Serge » Mon Oct 30, 2006 6:35 pm

I have a java library that I want to share between several GWT projects. This library should be used on the client (GWT will compile it to js). I used only the GWT supported java subset for it. Eclipse does not give me any errors, it finds the library, but when I use GWT Builder deploy tool I get a error:

The import com.mysite.clientutil cannot be resolved
Serge (gymgoal.com)
Serge
 
Posts: 11
Joined: Fri Oct 27, 2006 10:31 am

Re: How to add a java library to client-side code?

Postby Eric Clayberg » Thu Nov 02, 2006 4:46 am

Serge wrote:I have a java library that I want to share between several GWT projects. This library should be used on the client (GWT will compile it to js). I used only the GWT supported java subset for it. Eclipse does not give me any errors, it finds the library, but when I use GWT Builder deploy tool I get a error:
The import com.mysite.clientutil cannot be resolved

Is that shared code in an imported module?

All code that is used in the client should be in some module. i.e. you should declare your common code as some com.mycompany.gwt.Utils (.gwt.xml) module and add <inherits name='com.mycompany.gwt.Utils'/> to your module with an EntryPoint, in same way that you add <inherits name='com.google.gwt.user.User'/>.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Serge » Thu Nov 02, 2006 5:43 am

It's in the "Required projects on the build path". I also tried making it a jar and using it as a "library". I've already figured out that I need to use "<inherits>". I also had to modify your ant task to include the source code of the "parent" module to the class path for gwt compiler.
Serge (gymgoal.com)
Serge
 
Posts: 11
Joined: Fri Oct 27, 2006 10:31 am

Postby Eric Clayberg » Fri Nov 03, 2006 6:21 am

Serge wrote:It's in the "Required projects on the build path". I also tried making it a jar and using it as a "library". I've already figured out that I need to use "<inherits>". I also had to modify your ant task to include the source code of the "parent" module to the class path for gwt compiler.

Give the latest build a try.

Now we add the source folders of any referenced projects. This should fix deployment compilation and running.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests