• 请不要在回答技术问题时复制粘贴 AI 生成的内容
moyuwa
V2EX  ›  程序员

windows 部署 页面乱码

  •  
  •   moyuwa · Mar 27, 2024 · 1564 views
    This topic created in 819 days ago, the information mentioned may be changed or developed.
    首先说明一下, 我是用 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>
    4 replies    2024-03-27 14:00:29 +08:00
    KamL
        1
    KamL  
       Mar 27, 2024
    <arguments>-jar system.jar" -Dfile.encoding=UTF-8 --spring.profiles.active=prod</arguments>
    Tumblr
        2
    Tumblr  
       Mar 27, 2024
    你起码给个截图,看看“乱码”是字体问题还是编码问题吧。。。
    别太相信环境变量,配置中最好是用绝对路径。

    另外,为什么要用 winsw 呢?不能直接安装为服务么?
    moyuwa
        3
    moyuwa  
    OP
       Mar 27, 2024
    @Tumblr 放不了截图哦
    dandel1on
        4
    dandel1on  
       Mar 27, 2024
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4164 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 05:32 · PVG 13:32 · LAX 22:32 · JFK 01:32
    ♥ Do have faith in what you're doing.