Java EE, MVN, Eclipse, Tomcat and other Chinese garbled problem solving methods

Source: Internet
Author: User

First, change the JDK default encoding to UTF-8, guaranteed to start the JVM does not appear Chinese garbled problem

1, at compile time, if we do not specify the encoding format of our Java source program with the-encoding parameter, then Javac.exe first obtains the encoding format that our operating system uses by default.

The JDK first obtains the operating system's file.encoding parameter (it holds the operating system default encoding format, such as WIN7, its value is GBK), when we do not add the compilation, the equivalent

Using the parameters: Javac-encoding GBK Xx.java, of course, there will be incompatible situations.

2, look at a picture below:

  

Description: Chinese operating system, default encoding is GBK

3. Change the GBK to UTF-8

Type the following command:

Set Java_tool_options=-dfile.encoding=utf-8-duser.language=en-duser.country=us

Or:

Set Java_tool_options=-dfile.encoding=utf-8

4, the following changes:

  

Second, eclipse garbled problem

Change Eclipse profile Eclipse.ini to add a word

  

Third, Tomcat garbled problem resolution

Modify the following 2:8080 port and AJP protocol 8009 listening Port

1<ConnectorConnectionTimeout= "20000"Port= "8080"Protocol= "http/1.1"Redirectport= "8443"Uriencoding= "UTF-8"  Usebodyencodingforuri = "true" />2 3 <!-- Define an AJP 1.3 Connector on port 8009 -->4 <port= "8009"  Protocol= "ajp/1.3"  Redirectport = "8443"  Uriencoding= " UTF-8 "/>          

Iv. Web container requests, etc.

To connect: http://www.cnblogs.com/enshrineZither/p/3732173.html

Java EE, MVN, Eclipse, Tomcat and other Chinese garbled problem solving methods

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.