自己根据业务构建的tomcat容器,代码中含有中文文件名的访问无法识别,报404错误,设置以下环境变量后也还是不行
LC_ALL="zh_CN.UTF-8"
LC_CTYPE="zh_CN.utf8"
LANG="zh_CN.utf8"
最后在tomcat的脚本文件catalina.sh文件中加入 . /etc/profile 命令后,重启容器就可以识别到中文文件名了。
# head /usr/local/tomcat/bin/catalina.sh #!/bin/sh . /etc/profile # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at