title: Change File Encoding of Apache Tomcat on Elastic Beanstalk
body: <p>I have exhausted all my options in trying to configure my test Elastic Beanstalk Server.</p>
  
  <p>I want my application to accept Chinese characters so I want to change the file.encoding to UTF8.</p>
  
  <p>This is the closest I have gotten to solution but this doesn't change the current non-UTF8 encoding.</p>
  
  <p>I created a .ebextensions folder with environment.config file below</p>
  
  <pre><code>files:
    "/tmp/update_tomcat_server_xml.sh":
      owner: root
      group: root
      mode: "000755"
      content: |
        #! /bin/bash
        export JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8"
  
  container_commands:
    00_update_tomcat_server_xml:
      command: source /tmp/update_tomcat_server_xml.sh
  </code></pre>
  
  <p>I can see the 00_update_tomcat_server_xml in the instance logs but this doesn't change tomcats character set. </p>
  
  <p>Also can I mention I am using the SpringBoot embedded Tomcat container.</p>