Chinaunix首页 | 论坛 | 博客
  • 博客访问: 144777
  • 博文数量: 27
  • 博客积分: 2011
  • 博客等级: 大尉
  • 技术积分: 332
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-02 16:13
文章分类

全部博文(27)

文章存档

2009年(18)

2008年(9)

我的朋友

分类: Java

2009-12-26 02:11:01

1:安装Ant

   下载,并解压到D:\Program Files\apache-ant-1.7.1

      设置环境变量ANT_HOMED:\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

   安装JDK5C:\Program Files\Java\jdk1.5.0_21

   设置环境变量JAVA_HOMEC:\Program Files\Java\jdk1.5.0_21

4:设置PATH环境变量

PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin

5:下载Tomcat5.5build.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:命令行cdE:\Tomcat55,执行ant

1:从下载文件。

2:下载依赖包到E:\Tomcat55\Tomcat55DependentPackage

3:编译

9:启动Tomcat

   执行E:\Tomcat55\build\build\bin目录下的startup.bat

10:验证

   浏览器打开

 

问题

1:开始执行ant会报错,因为一个路径已经不存在了,修改就可以。

E:\Tomcat55>ant

Buildfile: build.xml

 

check.source:

 

get.source:

 

checkout:

     [echo] If the checkout fails, see 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: 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

 

5JDK需要JDK5JDK6会报错,原因是一些接口在6中有改变。

下载安装JDK5,设置JAVA_HOMT指向JDK5

6:编译过程中报错

类文件具有错误的版本 50.0,应为 49.0 请删除该文件或确保该文件位于正确的类路径子目录中。

把这些jar文件删除,会自动生成新的,通过。

阅读(4726) | 评论(1) | 转发(0) |
0

上一篇:Apache poi生成excel文件

下一篇:没有了

给主人留下些什么吧!~~

fxbird2011-11-09 10:57:08

及时雨啊,tomcat官方文档说得很不详细,没说明用啥jdk,我先试了1.6,不行,后来换了1.5,又出现了:类文件具有错误的版本 50.0,应为 49.0 。幸好找到这个blog,谢谢LZ分享。