java 在 Jenkins 中找不到 JDK 和 Maven 配置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38868468/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 03:51:15  来源:igfitidea点击:

Can not find JDK and Maven Configuration in Jenkins

javamavenjenkins

提问by Kunle

I'm new to Jenkins and I am trying to configure my JDK and Maven home locations in Manage Jenkins > Configure, but I do not see those sections in the page. How do how make them visible?

我是 Jenkins 的新手,我正在尝试在“管理 Jenkins”>“配置”中配置我的 JDK 和 Maven 主位置,但我在页面中看不到这些部分。如何使它们可见?

Jenkins - Configure System enter image description here

Jenkins - 配置系统 在此处输入图片说明

回答by Neeraj Bansal

The JDKs and Maven are managed and specified under "Manage Jenkins" -> "Global Tool Configuration" -> "JDK installations" and "Maven Installations"

JDK 和 Maven 在“管理 Jenkins”->“全局工具配置”->“JDK 安装”和“Maven 安装”下管理和指定

回答by captainblack

On Jenkins 2.46 & up:

在 Jenkins 2.46 及更高版本上:

Go to Manage Jenkins > Global Tool Configuration.

转到管理 Jenkins > 全局工具配置。

On that page, you can individually add the JDK and Maven paths by clicking on JDK installations...and Maven installations...buttons respectively.

在该页面上,您可以通过分别单击JDK 安装...Maven 安装...按钮来单独添加 JDK 和 Maven 路径。

回答by Cs_Lu

In: Manage Jenkins > Global Tool Configuration, find JDK

在:Manage Jenkins > Global Tool Configuration,找到JDK

  1. To install local JDK files, uncheck "Install automatically", then you can paste your local file location in JAVA_HOME

  2. To download automatically, choose your option from Add Installer

  1. 要安装本地 JDK 文件,请取消选中“自动安装”,然后您可以将本地文件位置粘贴到 JAVA_HOME

  2. 要自动下载,请从添加安装程序中选择您的选项

I had tried both method, however only first one works for me. Hope this help.

这两种方法我都试过,但只有第一种对我有用。希望这有帮助。

回答by RaviKiran

The JDKs and Maven are managed and specified under "Manage Jenkins" -> "Global Tool Configuration" -> "JDK installations" and "Maven Installations" :- this worked as it helps in providing the required jdk version using the dropdown option and once we start to build any project, the jenkin will automatically download the jdk and the compilation error will not appear.

JDK 和 Maven 在“管理 Jenkins”->“全局工具配置”->“JDK 安装”和“Maven 安装”下进行管理和指定:- 这有助于使用下拉选项提供所需的 jdk 版本,并且一次我们开始构建任何项目,jenkin会自动下载jdk,不会出现编译错误。

回答by Suresh Madhusanka

JDK and Maven configurations can be setup in Jenkins using, Manage Jenkins -> Global tool configurations.

JDK 和 Maven 配置可以在 Jenkins 中使用,管理 Jenkins -> 全局工具配置进行设置。

回答by Tim

Search JDK and Maven inside the config page, you will find the place.

在配置页面中搜索JDK和Maven,你会找到这个地方。

Example to config the jdk

配置jdk的示例

Example to config the maven

配置 Maven 的示例