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

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

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

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!