已解决:
bat中增加:
chcp 65001
例子:
@echo off chcp 65001 rem ------------------------------------------------------------------------- rem rem 使用说明: rem rem 1: 该脚本用于别的项目时只需要修改 MAIN_CLASS 即可运行 rem rem 2: JAVA_OPTS 可通过 -D 传入 undertow.port 与 undertow.host 这类参数覆盖 rem 配置文件中的相同值此外还有 undertow.resourcePath, undertow.ioThreads rem undertow.workerThreads 共五个参数可通过 -D 进行传入 rem rem 3: JAVA_OPTS 可传入标准的 java 命令行参数,例如 -Xms256m -Xmx1024m 这类常用参数 rem rem rem ------------------------------------------------------------------------- setlocal & pushd rem 启动入口类,该脚本文件用于别的项目时要改这里 set MAIN_CLASS=com.steel.main.MyConfig rem Java 命令行参数,根据需要开启下面的配置,改成自己需要的,注意等号前后不能有空格 rem set "JAVA_OPTS=-Xms256m -Xmx1024m -Dundertow.port=80 -Dundertow.host=0.0.0.0" rem set "JAVA_OPTS=-Dundertow.port=80 -Dundertow.host=0.0.0.0" set APP_BASE_PATH=%~dp0 set CP=%APP_BASE_PATH%config;%APP_BASE_PATH%lib\* java -Xverify:none %JAVA_OPTS% -cp %CP% %MAIN_CLASS% endlocal & popd pause
本地用eclipse打开,输出都正常,用bat打开,就开头两句undertow-server:正常,其他info输出都乱码!~
Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release. undertow-server: 优先使用配置文件中的 undertow.port = 82 undertow-server: 优先使用配置文件中的 undertow.devMode = true Starting JFinal 4.9.01 -> http://0.0.0.0:82 Info: jfinal-undertow 2.1, undertow 2.0.30.Final, jvm 14.0.2 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 0 [main] INFO com.alibaba.druid.pool.DruidDataSource [ ] 鈥?{dataSource-1} inited Sql: SELECT * FROM `stock` 348 [main] INFO org.apache.log4j.Logger [ ] 鈥?璇诲彇閽㈠嵎鎼滅储 Sql: SELECT company.companyName from company 400 [main] INFO io.undertow [ ] 鈥?starting server: Undertow - 2.0.30.Final 406 [main] INFO org.xnio [ ] 鈥?XNIO version 3.3.8.Final 415 [main] INFO org.xnio.nio [ ] 鈥?XNIO NIO Implementation Version 3.3.8.Final Starting Complete in 0.9 seconds. Welcome To The JFinal World (^_^)