Mark Schmit
Mark Schmit

Reputation: 477

How to make GWT find source in linked folders?

I'd like to create a GWT (2.0.4) project but with my source in a common java directory that's not kept under the GWT project directory.

I did the following:

1) Created new project 'game' in package com.mycomp.project.game. This worked fine, with its source under C:\java\Projects\game\src\com\mycomp\project\game.

2) Copied the code into C:\java\com\mycomp\project\game

3) Deleted the directories under C:\Projects\game\src\

4) File, New Folder, Advanced/Link to folder in filesystem to make a 'com' folder under src that links to C:\java\com.

This worked enough that I can see all the source under a com.mycomp.project.game folder in Eclipse, but when I try to run my project I now get errors of "Unable to find type 'com.mycomp.project.game.client.Game'".

Does GWT just not work with these links to filesystem folders? Is there any way for me to keep my Java code somewhere outside of my project directory but still have it work in GWT?

Thanks.

Upvotes: 4

Views: 1468

Answers (1)

Arthur Maltson
Arthur Maltson

Reputation: 6100

You have two options.

  • Move the source code into a directory under your GWT module (.gwt.xml file) location and change the <source path="" /> to point to the shared directory and the client code.
  • Create a JAR file with the source you want to reuse. The JAR will also have to have a GWT module. In your existing project you'll have to <inherit ... /> that reusable JAR.

Upvotes: 2

Related Questions