In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to build Tomcat from the source code. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something from this article.
This time we start with the source code to build a Tomcat process.
Install JDK
Needless to say, every Java developer has learned about this installation process on the first day of learning the language. The only thing to note is that different Tomcat versions need to correspond to different JDK, so if the JDK version is too low, the compilation of the new version of Tomcat may not be successful.
Install Apache Ant
What does Ant do? Users who have compiled and installed Linux/Unix software are aware of make. Ant is the tool for building Java applications. Note here that the version of Ant should not be old. The installation process is also similar to Java tools such as JDK/Maven, which can be unzipped and configured for ANT_HOME, and then added to Path to make it executable. When the installation is complete, the command line executes ant-version to confirm that the installation is correct.
Download the Tomcat source code
You can download the Tomcat source code on github.
You can also download it from the official SVN repository and select the specific version directly.
From the location where the distribution package is downloaded on the official website, you can download the Tomcat and source code of the latest release directly, and those who have been archived can download the distribution and source code in the archive file.
Edit the build configuration file
In the Tomcat source code, two files to be used by Ant are included by default:
Build.properties.default
Build.xml
Copy a copy of the build.properties.default file, repeat the command to build.properties, and then modify the base.path. Here, set an absolute path to store the third-party libraries that tomcat depends on downloaded during the construction process.
Then modify the build.xml to comment out the following
The comment is because it will get a nsis.exe file when downloading the dependency, which will be used to generate the tomcat installer on the windows platform. We don't need it here, so we can remove it from ant's build file build.xml. Otherwise, the following exception is easy to occur because of the certificate problem.
Javax.net.ssl.SSLHandshakeException:
Sun.security.validator.ValidatorException:PKIX path building failed: sun.securi
Ty.provider.certpath.SunCertPathBuilderException:unable to find valid certifica
Tion path to requested target
Of course, there is also a solution to this abnormal problem online, but it is more troublesome than annotations.
Then execute the command ant in the root directory of the source code and wait for the build to complete. By default, a build directory is generated under the output directory of the source code, which is the same as the Tomcat we unzipped zip.
In addition, if an exception like ConnectionTimeout occurs during the execution of the ant command, you can repeat it several times.
After reading the above, do you have any further understanding of how to build Tomcat from source code? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.