- 论坛徽章:
- 0
|
1:安装Ant
下载
apache-ant-1.7.1-bin.tar.gz
,并解压到D:\Program Files\apache-ant-1.7.1。
设置环境变量ANT_HOME为D:\Program Files\apache-ant-1.7.1。
2:安装SVN
下载Slik-Subversion-1.6.6-win32.msi,安装即可。
3:安装JDK5
下载jdk-1_5_0_21-windows-i586-p.exe。
安装JDK5到C:\Program Files\Java\jdk1.5.0_21。
设置环境变量JAVA_HOME为C:\Program Files\Java\jdk1.5.0_21。
4:设置PATH环境变量
PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
5:下载Tomcat5.5的build.xml文件。
文件路径为
http://tomcat.apache.org/tomcat-5.5-doc/build.xml
。
放到E:\Tomcat55目录下。
6:创建build.properties文件
放到E:\Tomcat55目录下。内容如下,表示让它把下载的依赖包放到
E:\Tomcat55\DependentPackage下面,否则会自动放到
E:\usr\share\java
# ----- Proxy setup -----
# Uncomment if using a proxy server.
#proxy.host=proxy.domain
#proxy.port=8080
#proxy.use=on
# ----- Default Base Path for Dependent Packages -----
# Replace this path with the directory path where
# dependencies binaries should be downloaded.
base.path=E:\\Tomcat55\\DependentPackage
7:修改build.xml文件,因为原来的路径不对。参见问题1。
value="tomcat/current/tc5.5.x" />
改为
8:命令行cd到E:\Tomcat55,执行ant。
1:从http://svn.apache.org/repos/asf/tomcat/tc5.5.x/tags/TOMCAT_5_5_27/下载文件。
2:下载依赖包到E:\Tomcat55\Tomcat55DependentPackage。
3:编译
9:启动Tomcat
执行E:\Tomcat55\build\build\bin目录下的startup.bat。
10:验证
浏览器打开
http://localhost:8080/index.jsp
。
问题
1:开始执行ant会报错,因为一个路径已经不存在了,修改就可以。
E:\Tomcat55>ant
Buildfile: build.xml
check.source:
get.source:
checkout:
[echo] If the checkout fails, see http://tomcat.apache.org/svn.html and htt
p://subversion.tigris.org/faq.html#proxy
[exec] svn: URL “http://svn.apache.org/repos/asf/tomcat/current/tc5.5.x”
不存在
BUILD FAILED
E:\Tomcat55\build.xml:113: The following error occurred while executing this lin
e:
E:\Tomcat55\build.xml:94: exec returned: 1
Total time: 15 seconds
2:下载struts-1.2.9-bin.tar.gz文件出错,
自己下载解压到E:\Tomcat55\Tomcat55DependentPackage。
[get] Getting: http://archive.apache.org/dist/struts/binaries/struts-1.2.9-bin.tar.gz
[get] To: E:\Tomcat55\Tomcat55DependentPackage\file.tar.gz
[gunzip] Expanding E:\Tomcat55\Tomcat55DependentPackage\file.tar.gz to E:\Tom
cat55\Tomcat55DependentPackage\file.tar
BUILD FAILED
E:\Tomcat55\build.xml:66: The following error occurred while executing this line
:
E:\Tomcat55\build\build.xml:1970: The following error occurred while executing t
his line:
E:\Tomcat55\build\build.xml:2013: Problem expanding gzip Unexpected end of ZLIB
input stream
3:下载tomcat-native-1.1.12-src.tar.gz文件出错,
自己下载解压到E:\Tomcat55\Tomcat55DependentPackage。
BUILD FAILED
E:\Tomcat55\build.xml:66: The following error occurred while executing this line
:
E:\Tomcat55\build\build.xml:1980: The following error occurred while executing t
his line:
E:\Tomcat55\build\build.xml:2031: Can't get http://tomcat.apache.org/dev/dist/to
mcat-connectors/native/tomcat-native-1.1.12-src.tar.gz to E:\Tomcat55\Tomcat55De
pendentPackage\tomcat-native-1.1.12\tomcat-native.tar.gz
4:编译报找不到类错误。把下面的jar包加到CLASSPATH环境变量
E:\Tomcat55\Tomcat55DependentPackage\servlet-api-2.4\lib\servlet-api.jar
5:JDK需要JDK5,JDK6会报错,原因是一些接口在6中有改变。
下载安装JDK5,设置JAVA_HOMT指向JDK5。
6:编译过程中报错
类文件具有错误的版本 50.0,应为 49.0 请删除该文件或确保该文件位于正确的类路径子目录中。
把这些jar文件删除,会自动生成新的,通过。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/20146/showart_2131204.html |
|