Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/402.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在服务结构中将Java JRE作为启动任务安装_Java_Windows_Azure Service Fabric - Fatal编程技术网

在服务结构中将Java JRE作为启动任务安装

在服务结构中将Java JRE作为启动任务安装,java,windows,azure-service-fabric,Java,Windows,Azure Service Fabric,我添加了jre-8u121-windows-x64.exe,并制作了install.cmd start /B /WAIT jre-8u121-windows-x64.exe /s SPONSORS=0 在我的/PackageRoot/code文件夹中 增加 <SetupEntryPoint> <ExeHost> <Program>install.cmd</Program> <WorkingFolder>CodePa

我添加了
jre-8u121-windows-x64.exe
,并制作了
install.cmd

start /B /WAIT jre-8u121-windows-x64.exe /s SPONSORS=0
在我的
/PackageRoot/code
文件夹中

增加

<SetupEntryPoint>
  <ExeHost>
    <Program>install.cmd</Program>
    <WorkingFolder>CodePackage</WorkingFolder>
    <ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048"/>
  </ExeHost>
</SetupEntryPoint>

在我的应用程序中,我以类似的方式运行setup.cmd文件,使用CodeBase而不是CodePackage,它工作正常。也许值得一试。看


Hans

您是否尝试过在install.cmd中不使用start而直接调用exe文件?它为安装创建了一个新的上下文,这可能是问题的一部分?是的,提供了与直接在服务清单中运行相同的结果。我现在找到了一个替代路径,将JRE也包括在我的包中。
<Principals>
<Users>
  <User Name="Admin">
    <MemberOf>
      <SystemGroup Name="Administrators" />
    </MemberOf>
  </User>
</Users>
<Policies>
  <RunAsPolicy CodePackageRef="Code" UserRef="Admin" EntryPointType="All" />
</Policies>
SetupEntryPoint:ExeEntryPointDescription { Program = jre-8u121-windows-x64.exe, Arguments = /s /L d:/javainstall.log, WorkingFolder = Work, PeriodicIntervalInSeconds = 0 ConsoleRedirectionEnabled = true ConsoleRedirectionFileRetentionCount = 5 ConsoleRedirectionFileMaxSizeInKb = 2048 } terminated with exitcode 1. CodePackageIdentifier { ServicePackageId = S-Innovations.Elastic.ElasticApplicationType_App31:S-Innovations.Elastic.ElasticServicePkg, CodePackageName = Code }:131369814689037041