windows 部署 页面乱码

44 天前
 moyuwa
首先说明一下, 我是用 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>
903 次点击
所在节点    程序员
4 条回复
cencoroll
44 天前
<arguments>-jar system.jar" -Dfile.encoding=UTF-8 --spring.profiles.active=prod</arguments>
Tumblr
44 天前
你起码给个截图,看看“乱码”是字体问题还是编码问题吧。。。
别太相信环境变量,配置中最好是用绝对路径。

另外,为什么要用 winsw 呢?不能直接安装为服务么?
moyuwa
44 天前
@Tumblr 放不了截图哦
caiqichang
44 天前

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1027411

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX