java - 将 Jenkins 安装为 Windows 服务时出现错误 "Service with id ' jenkins' 已存在

标签 java jenkins jenkins-pipeline

我在将 Jenkins 安装为 Windows 服务时遇到问题: 这是错误日志:

Error
Installing a service
[.jenkins] $ C:\Users\Lenovo-I7\.jenkins\jenkins.exe install
2019-08-17 15:43:47,662 INFO  - Installing the service with id 'jenkins'
Service with id 'jenkins' already exists
To install the service, delete the existing one or change service Id in the configuration file
2019-08-17 15:43:47,667 FATAL - Unhandled exception
System.Exception: Installation failure: Service with id 'jenkins' already exists
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)
System.Exception: Installation failure: Service with id 'jenkins' already exists
   at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
   at winsw.WrapperService.Main(String[] args)

我之前也曾在我的系统中安装过 Jenkins,但我遇到了一些问题,所以我卸载了它并重新安装了它。现在我遇到了这个问题。 任何帮助,将不胜感激。 谢谢

最佳答案

正如错误所示,必须有一些名为 jenkins 的现有服务。要删除它,请使用提升的权限(即以管理员身份运行)打开命令提示符,然后键入命令:sc delete jenkins

有关sc命令的更多详细信息,您可以引用this页。

关于java - 将 Jenkins 安装为 Windows 服务时出现错误 "Service with id ' jenkins' 已存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57535390/

相关文章:

jenkins - 无法在 Jenkins 管道中将作业状态设置回成功

docker - 如何在 Jenkins 管道中使用多个 docker 存储库

java - 为 Tomcat7 使用 Java 1.8 编译?

java - 如何修复java编译时的一些错误

maven - 如何在 mvn 中运行脚本作为测试

java - 无法安装 Jenkins 的 SSH 代理插件

java - 如何从Java应用程序获取Jenkins环境变量?

java - 在 Clojure/Java 中通过自定义协议(protocol)建立 HTTP 隧道

java - 使用SectionStatPageAdapter和bundle将数据从 Activity 发送到多个 fragment

java - Jenkins Artifactory 插件 + Maven Flatten 插件 + rtMavenDeployer。有没有办法部署扁平pom文件?