我在 mac os 10.8.3 上运行 Eclipse Juno。 我使用 eclipse 安装了 GWT (2.5.2) 插件,但是当我尝试运行我的项目时,总是出现此错误:
BUILD FAILED
/../../${env.GWT_HOME} does not exist.
也在我的构建文件中,在以下行中:
<taskdef resource="dml-ant.xml" classpathref="project.classpath"/>
它显示了同样的错误。
现在我已经看到了 THIS和 THIS线程,但没有一个解决方案有效。
在 eclipse 之外,我在 .profile 文件中定义了 GWT_HOME,如下所示:
export GWT_HOME=/Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1
在 Eclipse 中,我有以下配置:
- Preferences->Google->Web Toolkit-> GWT::2.5.1::[Location of the gwt-2.5.1 folder in plugins]
- Preferences->Java->Build Path->Classpath Variables-> GWT_HOME [defined to the same place]
在我的项目中:
- Properties->Google->Web Toolkit (only one selected)-> Use default SDK (GWT - 2.5.1)
- Properties->Java Build Path->Order and Export->GWT SDK [GWT - 2.5.1] almost on top (above maven libraries, at least)
我尝试过一些东西,比如更改 gwt-2.5.1 文件夹(以及它的 GWT_HOME 路径),重新安装几次并使用旧版本,多次重新启动 eclipse 和计算机等。 我可能在这里遗漏了一些明显的东西,这是我第一次使用 GWT(也是第一次使用 Eclipse)。
预先感谢您的所有帮助:)
最佳答案
你的项目是用ant设置的,不是吗?,如果是这样:
您的 ant 文件 build.xml 似乎没有以下行:
<property environment=”env”/>
也会发生这样的情况:运行 eclipse 时,它不会获取您在 .profile 中设置的环境变量,也许您必须从命令行启动 eclipse。
最后,作为快速修复,编辑 ant.xml 文件并将所有出现的 ${env.GWT_HOME} 替换为/Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1。
关于java - GWT_HOME 不存在 (mac 10.8.3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15839477/