eclipse Ant 构建脚本完全挂起,控制台中没有消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2457827/
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
Ant build scripts totally hangs, with no messages in console
提问by xchg.ca
I have build.xml for my project, but even this small piece of code
我的项目有 build.xml,但即使是这一小段代码
<target name="init">
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
It doesn't run
它不运行
Console is empty but process is active. I still can terminate it over STOP button
控制台为空,但进程处于活动状态。我仍然可以通过 STOP 按钮终止它
In same time I cannot debug it as well, same stuff active process no output in console and I can wait forever! Any ideas?
同时我也无法调试它,同样的东西活动进程在控制台没有输出,我可以永远等待!有任何想法吗?
- JDK 1.6.0_14
- Eclipse 3.5.1
- JDK 1.6.0_14
- 日食 3.5.1
Edited: Thank to Peter's Loron question I checked workspace log file MyWorkspace/.metadata/.log There I saw error message I googled it and found that this happening because location of my Eclipse changed, but path to ANT jars remains old. TO Fix that you have to go Preferences->Ant->Runtime and click Restore Default it will pickup new jar location and warn you about absence of tools.jar, copy it from somewhere and drop it in same folder where other ant jars.
编辑:感谢 Peter 的 Loron 问题,我检查了工作区日志文件 MyWorkspace/.metadata/.log 在那里我看到了错误消息,我用谷歌搜索它并发现这是因为我的 Eclipse 的位置发生了变化,但 ANT jars 的路径仍然是旧的。要修复您必须转到 Preferences->Ant->Runtime 并单击 Restore Default 它将拾取新的 jar 位置并警告您缺少 tools.jar,从某处复制它并将其放到其他 ant jar 所在的同一文件夹中。
采纳答案by xchg.ca
Edited: Thank to Peter's Loron question I checked workspace log file MyWorkspace/.metadata/.log There I saw error message I googled it and found that this happening because location of my Eclipse changed, but path to ANT jars remains old.
编辑:感谢 Peter 的 Loron 问题,我检查了工作区日志文件 MyWorkspace/.metadata/.log 在那里我看到了错误消息,我用谷歌搜索它,发现这是因为我的 Eclipse 的位置发生了变化,但 ANT jars 的路径仍然很旧。
TO Fix that you have to go Preferences->Ant->Runtime and click Restore Default it will pickup new jar location and warn you about absence of tools.jar, copy it from somewhere and drop it in same folder where other ant jars.
要修复您必须转到 Preferences->Ant->Runtime 并单击 Restore Default 它将拾取新的 jar 位置并警告您缺少 tools.jar,从某处复制它并将其放到其他 ant jar 所在的同一文件夹中。
回答by Jeremy Bunn
Here is yet another possible fix:
这是另一个可能的修复方法:
- Go to
Preferences->Ant->Runtime
- Classpath tab
- Click
Restore Defaults
button.
- 去
Preferences->Ant->Runtime
- 类路径选项卡
- 单击
Restore Defaults
按钮。
That happened to fix the issue for me.
那恰好为我解决了这个问题。
回答by Nigel
I'm using IBM RAD7 (which is based on Eclipse) and I was having exactly the same problem. After much fiddling I went to "External Tools" | JRE Tab | select "Run in same JRE", mine was set yo use the Webpshere JRE. Took a day to fix it! Nigel
我正在使用 IBM RAD7(基于 Eclipse)并且我遇到了完全相同的问题。经过多次摆弄后,我去了“外部工具”| JRE 选项卡 | 选择“在同一个 JRE 中运行”,我的设置是使用 Webpshere JRE。花了一天时间解决!奈杰尔
回答by Frank
Another quick thing to look for... Check your VM memory specs... I was messing around with low memory settings and it caused the same issues as above...
另一个需要快速查找的东西...检查您的 VM 内存规格...我在处理低内存设置时遇到了与上述相同的问题...
回答by Friederike
If you are running the script using "External Tools Configuration" you should also check the following:
如果您使用“外部工具配置”运行脚本,您还应该检查以下内容:
Open "External Tools Configuration" and select the launcher that starts the Ant script. In the tab "Common" make sure that "Allocate console (necessary for input)" is checked!
打开“外部工具配置”并选择启动 Ant 脚本的启动器。在“Common”选项卡中,确保选中“Allocate console (necessary for input)”!
In my case it was not checked and was the reason why no console output was visible.
在我的情况下,它没有被检查,这就是为什么没有控制台输出可见的原因。