Home >Operation and Maintenance >CentOS >How to solve the centos jdk garbled problem
Solution to centos jdk garbled code: 1. Enter the winscp login interface and set the file name UTF-8 encoding to on; 2. Enter the CentOS virtual machine and modify the "/etc/sysconfig/i18n" file That’s it.
The operating environment of this article: CentOS 7 system, winscp version 5.19.5, Dell G3 computer.
How to solve the centos jdk garbled problem?
Solve the problem of Chinese garbled characters when installing jdk in CentOS virtual machine:
(1) I installed jdk on the virtual machine by using the winscp tool. To achieve this, first double-click winscp.exe to enter the winscp login interface, and set the file name UTF-8 encoding to on in the environment item, as shown in the following figure:
(2) Then Click the session option, enter the host name, user name and password, click Save, and log in, as shown in the figure below:
(3) Next enter the CentOS virtual machine On the machine, enter the /etc/sysconfig/i18n file and modify the content to:
LANG="zh_CN.GB18030" LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN" SUPPORTED="zh_CN.GB18030:zh_CN:zh" SYSFONT="lat0-sun16" SYSFONTACM="8859-15"
Click save and exit, as shown below:
(4) Finally, enter the root@localhost command box and enter javac. The previous garbled characters have been changed to Chinese characters, as shown in the figure below (Note: I have already installed jdk on this virtual machine before, so I just entered javac to verify the jdk. Garbled characters appear when the installation is successful. If readers want to see how to install jdk in a virtual machine, please Baidu)
## Recommended tutorial: "The above is the detailed content of How to solve the centos jdk garbled problem. For more information, please follow other related articles on the PHP Chinese website!