On 15 mai, 16:06, Jake B <otakuj...@gmail.com> wrote:
> Hi all,
>
> Thanks again for the responses. See my replies below:
>
> On Fri, May 15, 2009 at 5:51 AM, Thomas Broyer <t.bro...@gmail.com> wrote:
>
> > On 15 mai, 03:06, Alyxandor <a.revolution.ultra.b...@gmail.com> wrote:
> >> Are you getting a "wrong package error"? Because if you aren't, you
> >> should!
>
> > Actually, I'd rather say you shouldn't add your "super" to the
> > projects build path (no need to compile the classes to Java .class,
> > with the risk of having them used in place of the Java runtime's ones;
> > only the source is needed, and only for the GWT Compiler, so what's
> > needed is that the "super" is in the classpath, not the build path!)
>
> OK, that's very interesting! The distinction between the classpath and
> the build path was not something that was clear to me before.
The classpath is what you need to build or launch a Java app (java,
javac, the GWT's Compile, HostedMode, etc.).
The buildpath is what you compile from *.java to *.class, and you MUST
NOT compile your "super-source" classes to *.class or the Java runtime
could use them instead of its own classes (and fail, quite obviously).
> Now, I
> believe it is, but I'm not sure, how do you add a path to the
> classpath without adding it to the build path in Eclipse?
In your launch config, in the classpath tab, your can add a folder
(select "user entries" then click the "advanced" button).
> The GWT
> module still needs to be found on the classpath. I took a look at the
> .classpath from gwt-in-the-air:
>
> http://www.google.com/codesearch/p?hl=en#7KCk1V3Al4I/trunk/.classpath....googlecode\.com
>
> It doesn't appear to reference super. Is this because .classpath sets
> the project build path in Eclipse?
Yes. And it defines the default classpath for your launch
configurations (hence the name).
> How do you then set the classpath
> so that the Emulation.gwt.xml module is finable, but not on the build
> path?
As said above, in the launch config ("Run" menu, then "Run
configurations..."; or replace "Run" with "Debug", they're the same
actually, at least in our case).
> > (however, adding it to the build path in Eclipse brings you better
> > editing, with better code completion, etc.)
>
> > Finally, it's more a matter of taste than a "rule" or even "best
> > practice"; but you have to understand what it means when you add the
> > "super" to the build path or not.
>
> I still don't have a clear sense of this. What would you say it means
> to add "super" to the build path?
See above, Eclipse would compile those *.java to *.class so your code
is "seen" un run by the Java runtime when you launch, say, the GWT's
Compiler (and the Compiler is then using your own OutputStream instead
of the "normal" one)
> >> Also, you've got to make your java.io hack-pack-age another level
> >> deeper...
>
> > Not necessarily. GWT's Emul package uses <super-source/>, and so do I
> > in GWT-in-the-AIR
> > (cf.http://code.google.com/p/gwt-in-the-air/source/browse/trunk/super/net...
> > )
>
> I still can't seem to get that to work :(
> Not sure why, but my use of the empty <super-source/> tag always
> causes GWT to fail. This is unfortunate, as it seems like it would be
> the best way to make both GWT and the IDE happy. So, for example, with
> gwt-in-the-air, my approach would have been to add
> /super/net/ltgt/gwt/air/emul/ as a source folder (so, on the build
> path). Then the emulated packages would be of the form java.*, which
> would correspond to the declared package names in the *.java files.
I'm personnally adding "super" as a source folder, and live with the
error about the "package" declaration (which Alyxandor talked about
earlier).
> This makes the IDE happy, and in my mind, it seems like GWT shouldn't
> have a problem with it either.
That's where you're wrong, and where it hurts (see above for the
explanation, GWT is then using your own java.io.OutputStream class)
> But, so far, this approach has always
> failed for me, and I cannot see the reason for this, or where the
> problem is originating. If someone can see it, and could point it out
> to me, I would be extremely grateful.
Before launching GWT (Compiler or HostedMode), remove "super" from the
build path. And make sure your launch configurations have "super"
added in the classpath (therefore, GWT will be able to see the *.java
files, but there wouldn't be corresponding *.class files to distract
the Java runtime)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---