V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
moyuwa
V2EX  ›  程序员

windows 部署 页面乱码

  •  
  •   moyuwa · 31 天前 · 884 次点击
    首先说明一下, 我是用 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 条回复    2024-03-27 14:00:29 +08:00
    cencoroll
        1
    cencoroll  
       31 天前
    <arguments>-jar system.jar" -Dfile.encoding=UTF-8 --spring.profiles.active=prod</arguments>
    Tumblr
        2
    Tumblr  
       31 天前
    你起码给个截图,看看“乱码”是字体问题还是编码问题吧。。。
    别太相信环境变量,配置中最好是用绝对路径。

    另外,为什么要用 winsw 呢?不能直接安装为服务么?
    moyuwa
        3
    moyuwa  
    OP
       31 天前
    @Tumblr 放不了截图哦
    caiqichang
        4
    caiqichang  
       31 天前
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   874 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 20:14 · PVG 04:14 · LAX 13:14 · JFK 16:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.