I experienced the same stylesheet problem within Eclipse using the following environment:
- Windows 7 x64
- Eclipse 3.7.2 (SR2) 32-bit
- JDK 1.6.0_32 32-bit
- Ant 1.7.2 (from Eclipse) or 1.7.4 (from Apache, current)
- Junit 4.8.1 (project dependency)
My build succeeds while using JDK 1.6.0_31, so it appears the stylesheet problem is an Ant or Java bug introduced with the release of Java 6 build 32. I could not find any reports in Apache's Bugzilla system. If it helps someone, these are the bug fixes included in build 32: http://www.oracle.com/technetwork/java/javase/2col/6u32bugfixes-1579554.html
My current workaround is to use Java 6 JDK build 31.
Update: Workaround to use a newer JDK
The Ant failures from within Eclipse started with a defect introduced in Java 6u32 and Java7u4. The saga is reported in Eclipse Bug #384757, including a workaround allowing you to use newer JDKs.
- Download the
org.apache.xalan
and org.apache.xml.serializer
plug-ins from the Eclipse Orbit project
- Copy them to a directory listed in the Java
java.ext.dirs
property
I use the following directories because they are defined by default and independent of JDK version:
- On Windows:
C:WindowsSunJavalibext
- On Mac:
/Users/$USER/Library/Java/Extensions
The root problem was reported to Oracle, but the bug is no longer in their bug database. I am not optimistic it will ever be fixed.
Update: Apache fixed the problem in Ant
Apache has fixed the root problem; it may be available in the Ant 1.9.0 release (Apache Bug #54641).
Update: Ant 1.9.1 scheduled for Eclipse 4.4
As @OliBlogger mentioned, Apache fixed the root problem in Ant 1.9.1. Eclipse plans to update to Ant 1.9.1 in Eclipse 4.4 (perhaps sooner, the Eclipse bug system does not yet have 4.3.x milestones).
Update: Fixed in Eclipse 4.4
I confirmed that my build now succeeds using Java 7 JDK build 67 and Ant 1.9.2 distributed with Eclipse 4.4.1 (Windows 7) without using the Orbit plug-in workaround.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…