The project XXX does not have any GWT SDKs on its

2019-01-17 03:35发布

问题:

Sometimes, when I start Eclipse (Java EE IDE for Web Developers, Indigo SR 1) on my MacOSX Lion, my GWT (2.4.0) project initially fails to compile.

Eclipse displays the following message in the "Problems" section:

The project XXX does not have any GWT SDKs on its build path

Here is a list of semi-solutions that sometimes work (I normally try them in this order):

  1. Project > Clean.
  2. Remove and re-add GWT SDK to the build path.
  3. Restart the machine.

Any help with preventing the problem from re-occurring would be most welcome.

回答1:

I encountered the same problems as described above. But none of the solutions worked.

What did work was moving the GWT SDK above the other GWT dependencies in the build path. See the following blog (written by my personal hero of the day): Grant Little's Blog



回答2:

I believe the problem was occurring because Eclipse had some stale settings about available/linked GWTs.

Therefore, building on the answer by Chris Cashwell, I recommend the following:

  1. Remove all GWTs from your build path. (You might have more than one GWT on your build path.)
  2. Remove all GWTs linked in Eclipse in Project>Properties>Google>Web Toolkit>Configure SDKs, .
  3. Add only the latest GWT, and make it default.

EDIT: Sometimes, I still need to do a Project > Clean, but this is rare now.



回答3:

I tried the above, but had to do a bit more:

From above:

  • Remove GWT SDK from my project
  • Remove all GWT SDKs from eclipse
  • Download new GWT SDK (2.5.0)
  • Add it to eclipse and to my project

What I did extra:

  • Edit the .classpath file of my project
  • Move the classpathentry for GWT to just under 'src'
  • Save the .classpath file
  • Close the project
  • Open the project

And that did it for me. Moving it in the Build Path GUI did not seem to work for me!

So, the start of my .classpath ended up looking like this:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
    etc...


回答4:

Project->Properties->Java Build Path, find GWT SDK in this list, click Edit.

  • If Use default SDK is checked make sure the default is available. If not, click Configure SDKs... and make sure you don't have an x symbol on your SDK. If so, remove it and re-add it.

  • If Use specific SDK is checked, make sure you've selected one that is available.



回答5:

In my case the GWT_CONTAINER was added below the JRE_CONTAINER. Fixing this manually within my .classpath file solved the problem!

<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>


回答6:

Also an other soulutin is to move the GWT SDK to the top of the Library list(right after your project) on the Properties/Java Build Path/Order and Export page.



回答7:

You could use maven for compilation and setting up your workspace.

However I guess this would be overkill for you.

There is a Maven GWT Plugin.