On 5 February 2011 21:14, Dallas007 <[email protected]> wrote:
> Hi,
> i am new to GWT so need help please. I'm am not able to compile my
> code due to below error.
>
> Here are my project details,
> I have added a new class Utility.java which is out side of Client
> package. I have instantiae the Utiltity object inside cliant code and
> imported the class. So I am not sure how to fix this could you please
> advise me on this?. How to use my Utility class in side client code?

See 
http://www.gwtapps.com/doc/html/com.google.gwt.doc.DeveloperGuide.Fundamentals.Modules.ModuleXml.html,
specifically the <source> tag.

I would suggest you create a separate module for your utility code.
The generated JAR should contain:

org/example/utils/Code.java
org/example/utils/Code.class
org/example/Utilities.gwt.xml

Where Utilities.gwt.xml has

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module
  PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN"
  
"http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd";
>
<module rename-to="Utilities">
  <inherits name="com.google.gwt.core.Core"/>
  <source path="utils"/>
</module>

Then you can use <inherits name="org.example.Utilities"/> to use your
utility code in other modules.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to