Tomcat设置-Dfile.encoding=UTF-8 系统默认文件编码

Windows环境下:
修改apache-tomcat-xxxxxx\bin\catalina.bat

tomcat7.X以下加上:

 set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%的后面加上 -Dfile.encoding="UTF-8"
  • 1

tomcat7.X加上:

  set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -Dfile.encoding=UTF-8"

例:tomcat7.0.11 

@echo off
set JAVA_OPTS=%JAVA_OPTS% -server -Xms4096m -Xmx4096m -XX:MaxNewSize=3072m -XX:PermSize=4096M -XX:MaxPermSize=4096m

rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

set "JAVA_OPTS=%JAVA_OPTS% %JSSE_OPTS% -Dfile.encoding=UTF-8" 
if "%OS%" == "Windows_NT" setlocal

  

 

 

 
posted @ 2020-12-05 10:54  无殇-x  阅读(1357)  评论(0编辑  收藏  举报