jenkins中jdk配置_如何在Jenkins中配置JDK

jenkins中jdk配置

如何在Jenkins中配置JDK (How to Configure JDK in Jenkins)

In the previous chapter, we learnt how to configure the Jenkins and start the server and see its GUI for other basic configurations. In this chapter will learn about configuring the JDK in Jenkins. Since Jenkins is commonly used for building and deploying the java applications, it offers excellent features for the same.

在上一章中,我们学习了如何配置Jenkins和启动服务器,以及如何查看其GUI的其他基本配置。 在本章中,将学习有关在Jenkins中配置JDK的信息。 由于Jenkins通常用于构建和部署Java应用程序,因此它提供了出色的功能。

As a default one, Jenkins will use the java version which it find from the system path. This is which the Jenkins itself running under. However there may be scenarios where there is a need to configure more than one version of the JDK. Consider, in the production system the application might be running on JDK 5 and in some QA platform higher version of the JDK may be required in order to perform some specific tests e.g. performance issues.

作为默认设置,Jenkins将使用从系统路径中找到的Java版本。 这就是詹金斯本身所处的地位。 但是,在某些情况下,需要配置多个JDK版本。 考虑一下,在生产系统中,该应用程序可能正在JDK 5上运行,并且在某些QA平台中,可能需要更高版本的JDK才能执行某些特定的测试,例如性能问题。

As a best practice, it is always advisable to build the applications using the java version which is close to the version used in the production environment. Because, the application developed under JDK 5 can run easily with JDK 6 but the inverse of this may always have a high chance of failure.

最佳做法是,始终建议使用与生产环境中使用的Java版本接近的Java版本来构建应用程序。 因为,在JDK 5下开发的应用程序可以轻松地与JDK 6一起运行,但是与此相反的情况总是有很大的失败机会。

Jenkins provides a good feature to configure multiple JVMs in order to overcome the above mentioned inverse java version issue.

Jenkins提供了一个很好的功能来配置多个JVM,以克服上述Java逆版本问题。

在Jenkins中配置JDK (Configuring JDK in Jenkins)

Below are the steps to be followed in order to configure the JDK in Jenkins :

以下是在Jenkins中配置JDK所需遵循的步骤:

  1. Deploy the Jenkins.war into the tomcat server and start the server.

    将Jenkins.war部署到tomcat服务器中并启动服务器。
  2. Manage Jenkins and click on 管理Jenkins” ,然后单击“ Configure System as shown below : 配置系统” ,如下所示:

    jenkins中jdk配置_如何在Jenkins中配置JDK

  3. jenkins中jdk配置_如何在Jenkins中配置JDK

    NOTE : The Jenkins will validate to check whether the installation directory exists for the specified JDK versions.注意: Jenkins将进行验证,以检查指定的JDK版本的安装目录是否存在。
  4. JDK can also be installed by intimating Jenkins to do the task. The check box install automatically needs to be checked in this case. Jenkins will download and installs the specified version of the JDK into the tools directory of the Jenkins home directory.

    jenkins中jdk配置_如何在Jenkins中配置JDK
  5. 也可以通过暗示Jenkins完成该任务来安装JDK。 在这种情况下,需要自动选中复选框安装 。 Jenkins将下载指定版本的JDK并将其安装到Jenkins主目录的tools目录中。

  6. After all the settings made to configure the JDK, just click the "Save" at the bottom of the page to save the configuration.

    完成配置JDK的所有设置后,只需单击页面底部的“保存”即可保存配置。

翻译自: https://www.studytonight.com/jenkins/configuring-jdk-in-jenkins

jenkins中jdk配置