英语翻译Important:This is not a supported means of building Tomcat; this information is provided without warranty :-).The only supported means of building Tomcat is with the "ant build" described above.However,some developers like to work on Java code with a Java IDE,and the following steps have been used by some developers.Note that you must complete all the above steps to fetch the repositories and build some JAR files the first time.After you have comp
英语翻译
Important:This is not a supported means of building Tomcat; this information is provided without warranty :-).The only supported means of building Tomcat is with the "ant build" described above.However,some developers like to work on Java code with a Java IDE,and the following steps have been used by some developers.
Note that you must complete all the above steps to fetch the repositories and build some JAR files the first time.After you have completed the above steps,you can set up a series of Eclipse 4 projects.Note that this will not let you build everything under Eclipse; the build process requires use of Ant for the many stages that aren't simple Java compilations.However,it will allow you to view and edit the Java code,get warnings,reformat code,perform refactorings,run Tomcat under the IDE,and so on.
You will want to set up your Eclipse project for building Tomcat such that ${tomcatSource} is the Workspace folder.
Use Windows->Preferences and then Java->Build Path->Classpath Variables to add two new Classpath variables:
TOMCAT_LIBS_BASE the base path where the binary dependencies have been downloaded
ANT_HOME the base path of Ant 1.6.2 or later
Use File->New Project to create a new Java project for each of the binaries repository (e.g.,/usr/share/java),container,connectors,jasper,servletapi.If you didn't already set up the Eclipse project such that ${tomcat.source} is the Workspace folder,do so now:tell Eclipse the external location using "Import/Export...",General->Existing Project into Workspace.
Eclipse .project and .classpath files are provided in each of these directories so Eclipse should find all source trees and jars,and hopefully compile without problems.Note that these files assume you are using Eclipse with a 5.0 or later JDK; also,the connectors module must be built with a compiler compliance level of 5.0.
To run Tomcat without a special IDE plug-in,you can simply use Run->Run...enter "org.apache.catalina.startup.Catalina" as the main class,"start" as program arguments,and "-Dcatalina.home=..." (with the name of your build directory) as VM arguments.
Note also that due to the way the Tomcat source is assembled from several SVN projects,you may not be able to use the Eclipse SVN client to update (nor to commit,if you are a committer).Use the external SVN client of your choice,then use the Eclipse PackageExplorer or Navigator "Refresh" context menu item to tell Eclipse that you've updated the files.
随便先翻译一点吧,有空再加点:
注意:这(下面)可不是编译tomcat的支持的方法;这里给你的信息是没有质保的:)唯一支持的编译tomcat的方法是用ant build.可是有些开发人员喜欢用ide,而且有些开发人员用过了下面这些步骤.
注意你必须先完成上面的步骤--从软件仓库得到(代码)并且编译一些jar文件.完成上面的步骤之后,你就可以建立一系列eclipse4项目了.注意这不是说你能用eclipse来编译代码;编译过程需要在很多地方用ant--那不是简单的编译代码,但是eclipse能让你查看和编辑java代码,可以看到警告信息,可以改版代码的格式,重构代码,在ide下运行tomcat等等.