首先说明一下, 我是用 java -jar 在 cmd 启动 同样的参数 页面没有乱码 使用 winsw 之后启动乱码 求助各路大神 下面是主要的配置内容同 有没有可能是没有读取到(猜测),我用了<env>貌似也没用
<service>
<!-- ID of the service. It should be unique across the Windows system-->
<id>epcos-modules-system</id>
<!-- Display name of the service -->
<name>system-server</name>
<!-- Service description -->
<description>system 系统服务</description>
<!-- Path to the executable, which should be started -->
<executable>java</executable>
<arguments>-jar system.jar -Dsun.jnu.encoding=utf-8 -Dfile.encoding=utf-8 --spring.profiles.active=prod </arguments>
<onfailure action="restart" delay="10 sec"/>
<onfailure action="restart"
delay="20 sec"/>
<resetfailure>1 hour
</resetfailure><!--OPTION: priorityDesired process priority.Possible values: Normal, Idle, High, RealTime, BelowNormal, AboveNormalDefault value: Normal-->
<priority>Normal
</priority><!-- OPTION: stoptimeoutTime to wait for the service to gracefully shutdown the executable before we forcibly kill itDefault value: 15 seconds-->
<stoptimeout>15 sec
</stoptimeout><!--OPTION: stopparentprocessfirstIf set, WinSW will terminate the parent process before stopping the children.Default value: false-->
<stopparentprocessfirst>false
</stopparentprocessfirst><!--OPTION: startmodeDefines start mode of the service.Supported modes: Automatic, Manual, Boot, System (latter ones are supported for driver services only)Default mode: Automatic-->
<startmode>Automatic</startmode>
<waithint>15 sec</waithint>
<sleeptime>1 sec</sleeptime>
<log mode="roll-by-size">
<sizeThreshold>10240</sizeThreshold>
<keepFiles>8</keepFiles>
</log>
</service>
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/1027411
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.