我在windows nanoserver上暴露了SGW_HOME变量,并试图在xml文件中使用它
<service>
<!-- ID of the service. It should be unique across the Windows system-->
<id>SGWJavaService</id>
<name>SGWJavaService</name>
<description>SGW Java service</description>
<env name="SGW_HOME" value="%SGW_HOME%"/>
<!-- Path to the executable, which should be started -->
<!-- CAUTION: Don't put arguments here. Use <arguments> instead. -->
<executable>java</executable>
<arguments>-jar %SGW_HOME%\\lib\\mgmt-node-1.0.0.jar</arguments>
</service>
我可以用命令创建服务
WinSW-x64.exe install sgw.xml
但服务无法启动
C:\program-files>sc query SGWJavaService
SERVICE_NAME: SGWJavaService
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 1067 (0x42b)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\program-files>
我如何使用env变量到xml文件?
1条答案
按热度按时间hgc7kmma1#
java -jar myjar.jar“.”