java 使用自动安装 JDK 在 windows 7 上安装和配置 Jenkins
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10695587/
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
Installation and configuration of Jenkins on windows 7 with auto-install JDK
提问by Sandman
I'm going through jenkins-the-definitive-guide. I have installed Jenkins on Windows 7 64 bit using the windows installer. I've configured a build and setup Jenkins to auto-install JDK 7u3 on the first build. When the build kicks off I see this in the console logs:
我正在阅读jenkins-the-definitive-guide。我已经使用 Windows 安装程序在 Windows 7 64 位上安装了 Jenkins。我已经配置了一个构建和设置 Jenkins 以在第一次构建时自动安装 JDK 7u3。当构建开始时,我在控制台日志中看到:
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\gameoflife-default
Installing C:\Program Files (x86)\Jenkins\tools\JDK_7u3\jdk.exe
[JDK_7u3] $ "C:\Program Files (x86)\Jenkins\tools\JDK_7u3\jdk.exe" /s /v /qn /L '\"C:\Program Files (x86)\Jenkins\tools\JDK_7u3\jdk.exe.install.log\"' REBOOT=ReallySuppress 'INSTALLDIR=\"C:\Program Files (x86)\Jenkins\tools\JDK_7u3\"'
It never progresses beyond this.
它永远不会超出这个范围。
I've tried: - ensuring the exe is not blocked - ensuring the service account has admin privileges - tried installing other JDKs.
我试过: - 确保 exe 没有被阻止 - 确保服务帐户具有管理员权限 - 尝试安装其他 JDK。
Any thoughts?
有什么想法吗?
回答by Jerry Qassar
There is an error in the JDK auto-installation for JDK7, it seems:
https://issues.jenkins-ci.org/browse/JENKINS-5408
JDK7的JDK自动安装有错误,似乎:https:
//issues.jenkins-ci.org/browse/JENKINS-5408
If you try running that command on the command line, you get the msiexec
dialog box, which implies that a parameter is incorrect. Since I am also having this issue, I went and looked at what Jenkins actually passes. It does (in our case):
如果您尝试在命令行上运行该命令,则会出现msiexec
对话框,这意味着参数不正确。由于我也遇到了这个问题,所以我去查看了 Jenkins 实际通过的内容。它确实(在我们的例子中):
c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /v /qn /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR=\"c:\jenkins\tools\JDK\jdk-1.7.0_06\"
The escaped quotes are a holdover from old-style msiexec
installations, where everything after the /v
had to be in single quotes because it was all getting passed through to something else. The single quote escapes were removed, but the actual syntax isn't correct any more either (the installer has changed, as have the options). The issue is the quote escaping being done in the INSTALLDIR
variable. If you remove that, it will sort-of-install (you may still have an msiexec process hanging). Example:
转义引号是旧式msiexec
安装的保留,其中 之后的所有内容都/v
必须在单引号中,因为它们都被传递给其他东西。单引号转义被删除,但实际语法也不再正确(安装程序已更改,选项也已更改)。问题是在INSTALLDIR
变量中进行的引号转义。如果您删除它,它将进行排序安装(您可能仍然有一个 msiexec 进程挂起)。例子:
c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR=\"c:\jenkins\tools\JDK\jdk-1.7.0_06\"
You might be able to go even further and use /norestart
rather than setting the reboot property, depending on whether or not it's respected.
您可能可以更进一步并使用/norestart
而不是设置重新启动属性,具体取决于它是否受到尊重。
All these suggestions I'm making still don't get to the actual problem, which is 'how to auto-install JDK7 correctly'. If you're having this problem, I don't know that you can without finishing the installation manually and then turning off auto-install in the main config. For me, cleaning the cache files didn't seem to help.
我提出的所有这些建议仍然没有解决实际问题,即“如何正确自动安装 JDK7”。如果您遇到此问题,我不知道您是否可以不手动完成安装然后在主配置中关闭自动安装。对我来说,清理缓存文件似乎没有帮助。