tomcat源码导入eclipse步骤
1. 获取源代码
方式一:从官网http://tomcat.apache.org/download-70.cgi 直接下载,官网提供了Binary 和 Source Code两种下载方式,要研究tomcat源代码,选择source code 方式下载
方式二:利用svn获取源代码,先安装svn,再新建目录tomcat7, 接着在目录里执行以下命令
- svn co http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_35/ ./
tags目录下有不同版本的tomcat 源码,这里下载的版本是7.0.35
2. 将源码导入eclipse
- BUILD FAILED build.xml:2361: The following error occurred while executing this line:
- BUILD FAILED build.xml:2449: Compile failed; see the compiler error output for details.
- build-tomcat-dbcp:
- [copy] Copying 64 files to E:\usr\share\java\tomcat7-deps\dbcp
- [move] Moving 64 files to E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp
- [javac] Compiling 64 source files to E:\usr\share\java\tomcat7-deps\dbcp\classes
- [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
- [javac] E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp\dbcp\BasicDataSource.java:53: error: Bas
- icDataSource is not abstract and does not override abstract method getParentLogger() in CommonDataSource
- [javac] public class BasicDataSource implements DataSource {
- [javac] ^
- [javac] E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp\dbcp\DelegatingStatement.java:46: error:
- DelegatingStatement is not abstract and does not override abstract method isCloseOnCompletion() in Statement
- [javac] public class DelegatingStatement extends AbandonedTrace implements Statement {
- [javac] ^
- [javac] E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp\dbcp\DelegatingPreparedStatement.java:57
- : error: DelegatingPreparedStatement is not abstract and does not override abstract method isCloseOnCompletion() in Stat
- ement
Total time: 2 minutes 57 seconds
- build-tomcat-dbcp:
- [copy] Copying 64 files to E:\usr\share\java\tomcat7-deps\dbcp
- [move] Moving 64 files to E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp
- [javac] Compiling 64 source files to E:\usr\share\java\tomcat7-deps\dbcp\classes
- [javac] 注意:某些输入文件使用或覆盖了已过时的 API。
- [javac] 注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
- [javac] 注意:某些输入文件使用了未经检查或不安全的操作。
- [javac] 注意:要了解详细信息,请使用 -Xlint:unchecked 重新编译。
- [jar] Building jar: E:\usr\share\java\tomcat7-deps\dbcp\tomcat-dbcp.jar
- [jar] Building jar: E:\usr\share\java\tomcat7-deps\dbcp\tomcat-dbcp-src.jar
3. 在build path里添加jar包,解决编译问题
- import javax.xml.rpc.Service;
- import javax.xml.rpc.ServiceException;
- import javax.wsdl.Definition;
- import javax.wsdl.Port;
- import javax.wsdl.extensions.ExtensibilityElement;
- import javax.wsdl.extensions.soap.SOAPAddress;
- import javax.wsdl.factory.WSDLFactory;
- import javax.wsdl.xml.WSDLReader;
4. 运行
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。