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