You can use a <super-source path="foo"/> in your gwt.xml to provide a different implementation of a java class for use client side.
However, there is limited support for annotations client side - there's no Class.getAnnotations() for example - so whatever you're doing may not work anyway. HTH Paul vinayak wrote: > Experts, > I have a simple gwt app. One of its class inside shared > dir has a import of javax.lang.model.element.AnnotationMirror. I am > using JDK1.6 for compiling my project in eclipse 3.4. > Eclipse shows me no errors. But when I click on gwt compile option I > get following error. > > [ERROR] Line 4: The import javax.lang cannot be resolved > > If I remove this import, it gwt compiles fine. > Class where this import is added needs to be translated to JS. Is > there any reason why GWT compiler will give this error. Does this have > anything to do with list of JRE classes that can be translated to JS > supported by GWT 2.3 ? List is given on > http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html > > If yes then another class which is not listed here when imported in my > shared class compiles properly. e.g if I import java.util.Observer > then it gwt compiles properly even when that is not part of the > emulation class list. > > Only difference between javax.lang.model.element.AnnotationMirror and > java.util.Observer is earlier is added in jdk1.6. Is it that my gwt > compiler is not picking up JDK1.6 classes ? How do I tell gwt compiler > to use JDK1.6 classes explicilty. I have JDK1.6 already specified > everywhere in my eclipse project. > > Thanks in advance. > > > Detailed error is given below. > > Compiling module com.test.Test > Validating newly compiled units > [ERROR] Errors in 'file:/E:/eclipse3.4/poc/Test/src/com/test/ > shared/FieldVerifier.java' > [ERROR] Line 4: The import javax.lang cannot be resolved > Finding entry point classes > [ERROR] Unable to find type 'com.test.client.Test' > [ERROR] Hint: Previous compiler errors may have made this > type unavailable > [ERROR] Hint: Check the inheritance chain from your module; > it may not be inheriting a required module or a module may not be > adding its source path entries properly > > -- 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.
