简体   繁体   English

无法在 Jenkins 上从 Oracle 安装 JDK

[英]Can't install JDK from Oracle on Jenkins

I defined in Jenkins JDK->install automatically-> selected JDK version -> I agree我定义在Jenkins JDK->自动安装->选择JDK版本->我同意

But when i ran a build the JDK installation fails with this error但是当我运行构建时,JDK 安装失败并出现此错误

 [jdk] $ /var/jenkins_home/tools/hudson.model.JDK/jdk/jdk.sh -noregister
/var/jenkins_home/tools/hudson.model.JDK/jdk/jdk.sh: 2: Syntax error: newline unexpected

Can you please help?

I tried to run a build with JDK+maven I expected to see the jdk 1.9 being installed running Thanks我尝试使用 JDK+maven 运行构建 我希望看到正在安装的 jdk 1.9 正在运行 谢谢

If was experiencing the same issue, try the following steps to resolve it:如果遇到同样的问题,请尝试以下步骤来解决它:

  1. Go to Jenkins > Manage Plugins. Go 至 Jenkins > 管理插件。
  2. Locate the plugin "Oracle Java SE Development Kit Installer."找到插件“Oracle Java SE Development Kit Installer”。
  3. Click "Uninstall" and confirm the action.单击“卸载”并确认操作。
  4. Restart your machine.重新启动机器。

This should fix the error.这应该可以修复错误。
It's unclear why this particular plugin causes the issue, but removing it seems to resolve it.目前还不清楚为什么这个特定的插件会导致问题,但删除它似乎可以解决问题。
To prevent the error from returning, make sure not to reinstall the plugin.为防止错误再次出现,请确保不要重新安装插件。 (ITS WEIRD I KNOW) (我知道这很奇怪)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM