简体   繁体   中英

Eclipse 3.4 ant task hangs

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?

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.

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.

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.

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.

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.

您是否在Eclipse 3.4发行说明中检查了Ant已知问题

您可以使用Eclipse的调试器运行ant构建,这可能有助于找出问题。

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.

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下解决的

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM