我正在使用 java JDK 7 在 Windows 2008 R2 上构建 cocoon 2.1.10 以最终在 Tomcat 7 中部署。我已经下载了 cocoon 源文件,解压缩它们,设置我的 JAVA_HOME 变量,然后尝试运行 build.bat提供的文件。我得到 11 个不同的编译错误。
D:\cocoon-2.1.10-src\cocoon-2.1.10>build.bat
Buildfile: build.xml
prepare:
====================================================================
Apache Cocoon 2.1.10 [1999-2006]
====================================================================
Building with Apache Ant version 1.6.5 compiled on June 2 2005
--------------------------------------------------------------------
Using build file D:\cocoon-2.1.10-src\cocoon-2.1.10\build.xml
--------------------------------------------------------------------
Compiler options:
- debug ......... [on]
- optimize ...... [on]
- deprecation ... [off]
====================================================================
compile-core:
Compiling 594 source files to D:\cocoon-2.1.10-src\cocoon-2.1.10\build\cocoon\classes
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:39: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.ImageFormatException;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:40: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGCodec;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:41: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGEncodeParam;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:42: error: package com.
sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGImageEncoder;
^
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:326: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
^
symbol: class JPEGImageEncoder
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:326: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
^
symbol: variable JPEGCodec
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:327: error: cannot find
symbol
JPEGEncodeParam p = encoder.getDefaultJPEGEncodeParam(currentImage);
^
symbol: class JPEGEncodeParam
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:333: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bstream);
^
symbol: class JPEGImageEncoder
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:333: error: cannot find
symbol
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bstream);
^
symbol: variable JPEGCodec
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:334: error: cannot find
symbol
JPEGEncodeParam p = encoder.getDefaultJPEGEncodeParam(currentImage);
^
symbol: class JPEGEncodeParam
location: class ImageReader
D:\cocoon-2.1.10-src\cocoon-2.1.10\src\java\org\apache\cocoon\reading\ImageReader.java:342: error: cannot find
symbol
} catch (ImageFormatException e) {
^
symbol: class ImageFormatException
location: class ImageReader
11 errors
BUILD FAILED
D:\cocoon-2.1.10-src\cocoon-2.1.10\tools\targets\compile-build.xml:68: The following error occurred while exec
uting this line:
D:\cocoon-2.1.10-src\cocoon-2.1.10\tools\targets\compile-build.xml:51: Compile failed; see the compiler error
output for details.
我还尝试在命令行上使用“构建战争”,这产生了相同的结果。
这是我正在使用的 JDK 的问题,还是我需要查看其他内容?这是我第一次尝试构建和部署茧,我可能会遗漏一些明显的东西。
问候,托尼