无法将Artifactory安装为Windows服务 [英] Artifactory cannot be installed as windows service

查看:327
本文介绍了无法将Artifactory安装为Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Artifactory artifactory-oss-6.10.1,我尝试将其安装为Windows服务.

I have Artifactory artifactory-oss-6.10.1, that I try to install as Windows service.

我遇到的第一个问题是installService.bat包含行

First problem I encounter is that the installService.bat has the lines

:gotJdkHome
if not exist "%JAVA_HOME%\jre\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\jre\bin\javaw.exe" goto noJavaHome

我已经安装了JDK 12,并将其设置为JAVA_HOME,但是我的JDK安装中没有jre文件夹.我从oracle重新下载了jdk 12,但是安装没有提供jre文件夹

I have JDK 12 installed and set as JAVA_HOME, but my JDK installation has no jre folder. I re-downloaded the jdk 12 from oracle, but the installation gives no jre folder

删除文件的jre路径后,由于缺少tomcat(?),安装失败(它只是说找不到路径).

After I removed the jre path of the file, the installation fails due to a missing tomcat (?) (it just say that it cannot find the path).

所以我需要额外安装tomcat吗?因为,当我简单地启动artifactory.bat时,Artifactory就会启动.

So do I need to additionally install tomcat ? Because, when i simply start the artifactory.bat, Artifactory starts up.

那么如何将Artifactory作为Windows服务安装?

So how can I install Artifactory as windows service ?

推荐答案

我也为此苦苦挣扎,并设法找到一种解决方案来安装该服务.

I struggled with this as well and managed to find a solution to get the service installed.

打开您的InstallService.bat文件.找到:gotJdkHome部分.从如下路径中删除\ jre:

Open your InstallService.bat file. Locate the :gotJdkHome section. Remove \jre from the pathes like the following:

:gotJdkHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
if not "%JRE_HOME%" == "" goto okJavaHome
set "JRE_HOME=%JAVA_HOME%"

然后,您将能够运行InstallService.bat,并且将安装该服务.

Then you will be able to run the InstallService.bat and the service will be installed.

但是,您将无法启动服务,因为Java 10不支持JVM参数"java.endorsed.dirs".

But you will not be able to launch the service because the JVM argument "java.endorsed.dirs" is not supported from Java 10.

您必须将其从文件底部的以下行中删除:

You have to remove it from the following line in the bottom of the file:

"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed" --StartMode jvm --StopMode jvm

为了获得

"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%" --StartMode jvm --StopMode jvm

现在,您的服务将可以启动.

Now your service will be able to start up.

这篇关于无法将Artifactory安装为Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆