eclipse 项目 XXX 在其构建路径上没有任何 GWT SDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8540620/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The project XXX does not have any GWT SDKs on its build path
提问by Rok Strni?a
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.
有时,当我在MacOSX Lion上启动Eclipse(Java EE IDE for Web Developers,Indigo SR 1)时,我的GWT (2.4.0) 项目最初无法编译.
Eclipse displays the following message in the "Problems"section:
Eclipse 在“问题”部分显示以下消息:
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):
以下是有时有效的半解决方案列表(我通常按此顺序尝试它们):
Project > Clean.- Remove and re-add GWT SDK to the build path.
- Restart the machine.
Project > Clean.- 删除 GWT SDK 并将其重新添加到构建路径。
- 重新启动机器。
Any help with preventing the problem from re-occurring would be most welcome.
任何防止问题再次发生的帮助将是最受欢迎的。
采纳答案by Rok Strni?a
I believe the problem was occurring because Eclipse had some stale settings about available/linked GWTs.
我相信问题的发生是因为Eclipse 有一些关于可用/链接 GWT 的陈旧设置。
Therefore, building on the answer by Chris Cashwell, I recommend the following:
因此,基于Chris Cashwell的回答,我推荐以下内容:
- Remove all GWTs from your build path.(You might have more than one GWT on your build path.)
- Remove all GWTs linked in Eclipsein
Project>Properties>Google>Web Toolkit>Configure SDKs, . - Add only the latest GWT, and make it default.
- 从构建路径中删除所有 GWT。(您的构建路径上可能有多个 GWT。)
- 删除 Eclipse中链接的所有 GWT
Project>Properties>Google>Web Toolkit>Configure SDKs。 - 仅添加最新的 GWT,并将其设为默认值。
EDIT:Sometimes, I still need to do a Project > Clean, but this is rare now.
编辑:有时,我仍然需要做一个Project > Clean,但现在很少见了。
回答by Hugo
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
有效的是将 GWT SDK 移动到构建路径中的其他 GWT 依赖项之上。请参阅以下博客(由我当天的个人英雄撰写): Grant Little 的博客
回答by Jamie
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
- 从我的项目中删除 GWT SDK
- 从 Eclipse 中删除所有 GWT SDK
- 下载新的 GWT SDK (2.5.0)
- 将它添加到 eclipse 和我的项目中
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
- 编辑我的项目的 .classpath 文件
- 将 GWT 的类路径移动到“src”下
- 保存 .classpath 文件
- 关闭项目
- 打开项目
And that did it for me. Moving it in the Build Path GUI did not seem to work for me!
这为我做到了。在构建路径 GUI 中移动它似乎对我不起作用!
So, the start of my .classpath ended up looking like this:
所以,我的 .classpath 的开头看起来像这样:
<?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...
回答by dfreis
In my case the GWT_CONTAINER was added below the JRE_CONTAINER. Fixing this manually within my .classpath file solved the problem!
在我的例子中,GWT_CONTAINER 被添加到 JRE_CONTAINER 之下。在我的 .classpath 文件中手动修复这个问题解决了这个问题!
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
回答by Chris Cashwell
Project->Properties->Java Build Path, find GWT SDKin this list, click Edit.
Project->Properties->Java Build Path,GWT SDK在此列表中找到,单击Edit。
If
Use default SDKis checked make sure the default is available. If not, clickConfigure SDKs...and make sure you don't have anxsymbol on your SDK. If so, remove it and re-add it.If
Use specific SDKis checked, make sure you've selected one that is available.
如果
Use default SDK选中,请确保默认值可用。如果没有,请单击Configure SDKs...并确保您x的 SDK 上没有符号。如果是这样,请将其删除并重新添加。如果
Use specific SDK选中,请确保您选择了一个可用的。
回答by Cogur
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.
另外一个重要的方法是将 GWT SDK 移动到 Properties/Java Build Path/Order and Export 页面上的库列表的顶部(在您的项目之后)。
回答by Udo Held
You could use mavenfor compilation and setting up your workspace.
您可以使用maven进行编译和设置您的工作区。
However I guess this would be overkill for you.
但是,我想这对您来说太过分了。
There is a Maven GWT Plugin.
有一个Maven GWT 插件。

