Home  >  Article  >  Java  >  Java program cannot display Chinese

Java program cannot display Chinese

王林
王林Original
2019-11-20 10:23:318435browse

Java program cannot display Chinese

1. Running java hello cannot display Chinese (displayed as garbled characters)

Java program cannot display Chinese

2. Running java javaCode displays the java default dial The code encoding is US-ASCII

Java program cannot display Chinese

3. Enter export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8, and run java javaCode again, and the encoding is changed to UTF -8

Java program cannot display Chinese

4. Run java hello again to display Chinese normally

Recommended tutorial: java quick start

The above is the detailed content of Java program cannot display Chinese. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to run java filesNext article:How to run java files