Eclipse 3.4 ant任务挂起
当我从 Eclipse 3.4.x 启动 ant 脚本时,它会将输出打印到控制台,直到某个阶段。 之后它经常挂起(永远等待)。 我在屏幕(控制台)上看到的最后几行 - 来自混淆器的部分输出。
在 Eclipse 3.3.2 下,一切工作正常(相同的项目、工作区、设置、JVM 等)。
有人有同样的问题吗? 有什么想法如何解决它吗?
When I launch an ant script from Eclipse 3.4.x it prints the output to console until certain stage. After that it often hangs (wait forever). Last lines that I see at the screen (console) - partial output from my obfuscator.
Under Eclipse 3.3.2 everything works fine (the same project, workspace, settings, JVM etc.).
Does anybody have the same issue? Any thoughts how to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
我在 Eclipse 3.6 和 Ant 1.7.1 中也可以看到这种现象。 就我而言,我必须将外部工具配置(菜单运行 -> 外部工具)中的 JRE 设置为“在与工作区相同的 JRE 中运行”,然后它才能正常工作。
I can see this phenomena with Eclipse 3.6 and Ant 1.7.1 as well. In my case I have to set the JRE in External Tool Configurations (Menu Run->External Tools) to "Run in the same JRE as the workspace", then it works fine.
我正在使用 Eclipse 3.4.2 并且 ant 任务挂起,ant 输出仅在一定级别上进入控制台,之后没有任何工作。
我查看了控制台的最后一行,发现了一些与 UTF-8 相关的问题。
这是消息(警告:无法映射用于编码 UTF8 的字符)。
转到外部工具。 选择ant任务,单击“公共选项卡”,将编码从默认(UTF-8)更改为ISO-8859-1。
i was using Eclipse 3.4.2 and ant task was hanging, ant output was getting onto the console only to a certain level and after that nothing was working.
I looked on the last line on the console and found some issue related to UTF-8.
This is the message (warning: unmappable character for encoding UTF8).
Go to External Tool. select the ant task, click on "Common Tab", change the encoding from default(UTF-8) to ISO-8859-1.
您是否限制了控制台可以分配的内存? 菜单“窗口”-> 首选项-> 运行/调试-> 安慰。
选择“限制控制台输出”
将“控制台缓冲区大小(字符)”设置为 200000。
您看到的效果可能与垃圾收集有关:控制台使用了太多 RAM,GC 开始占用所有可用的 CPU 周期来进行清理。
Did you limit the memory your console can allocate? Menu "Window" -> Preferences -> Run/Debug -> Console.
Select "Limit console output"
Set "Console buffer size (characters)" to 200000.
The effect you're seeing might be related to the garbage collection: The console used up too much RAM and GC is starting to eat all available CPU cycles to clean up.
我们遇到了类似的问题,但无法通过升级到最新的 Eclipse 版本来解决。 一段时间后,我们发现这是由向控制台写入特殊字符(德语变音符号ü)的任务引起的。 将 char 更改为“ue”后,一切正常。
我想这个角色以某种方式杀死了 Eclipse 中的“从 ant 获取字符并将它们写入控制台”线程。 Ant继续向通信管道写入字符,最终将其填满并永远阻塞。
We had a similar problem, which we couldn't fix by upgrading to the latest Eclipse version. After some time we found out that it was caused by a task which wrote a special character (German Umlaut ü) to the console. After changing the char to "ue", everything worked fine.
I suppose that character somehow killed the "get characters from ant and write them to the console" thread in Eclipse. Ant continued to write characters to the communication pipe, finally filled it up and blocked forever.
一个可能的原因是您内存不足
还尝试使用
-diagnostics
选项运行 ant。您可以检查您的内存使用情况和eclipse.ini。
另一个典型的罪魁祸首是阻止对锁定资源的访问(例如对已被另一个进程使用的文件的访问):尝试关闭许多可以关闭的应用程序并重新启动 ant。
One possible cause is that you are running out of memory
Also try to run ant with the
-diagnostics
option.You can check your memory usage and your eclipse.ini.
Another classic culprit is a blocking access to a locked resource (like an access to a file already being used by another process): try to close a many applications you can and relaunch ant.
您是否检查了 Ant 的已知问题在 Eclipse 3.4 发行说明中?
Did you check the known issues for Ant in the Eclipse 3.4 release notes?
您可以使用 Eclipse 的调试器运行 ant 构建,这可能有助于找出问题。
You can run ant builds using Eclipse's debugger, which might help find out the issue.
不久前我就遇到过这样的事。 我需要删除与 Ant 相关的所有外部工具配置(菜单运行 -> 外部工具),将默认 JRE 设置为 1.6 并重新启动 Eclipse。 然后我的任务就成功了。
That happened to me a while ago. I needed to erase all External Tool Configurations (Menu Run->External Tools) related to Ant, set the default JRE to 1.6 and restart Eclipse. Then my tasks worked.
看起来 Eclipse 3.4.x 中的 ant 实现已部分损坏(与 Eclipse 3.4 和 3.4.1 相关)。 前几天在Ant任务(dbunit)中遇到了OOM。 如果没有 Eclipse,ant 任务可以正常工作(针对 bot ant 1.6.5 和 1.7.0 进行测试)。
希望 3.5 和 3.4.2 解决 ant 实现的不可预测的行为。
Looks like ant implementation in Eclipse 3.4.x is partially broken (relevant for both Eclipse 3.4 and 3.4.1). Couple days ago met OOM in Ant task (dbunit). Without Eclipse the ant task works fine (test for bot ant 1.6.5 and 1.7.0).
Will hope that 3.5 and 3.4.2 resolve that unpredictable behavior of ant implementation.
看起来大多数 ant 问题都在 Eclipse 3.4.2 下解决了
Looks like most ant issues were resolved under the Eclipse 3.4.2