How can I add UTF-8 support in eclipse? I want to add for example Russian language but eclipse won't support it. What should I do? Please guide me.
- 1do you want to use translated eclipse or simply change the file encoding?soulcheck– soulcheck2012-02-07 17:39:53 +00:00Commented Feb 7, 2012 at 17:39
- Is this about code, or resources? UTF-8 resource support takes a bit more work.Nyerguds– Nyerguds2016-09-06 07:55:07 +00:00Commented Sep 6, 2016 at 7:55
- I need Chinese language support in eclipse for Selenium WebDriver tests.Ripon Al Wasim– Ripon Al Wasim2017-06-15 05:24:31 +00:00Commented Jun 15, 2017 at 5:24
12 Answers
Try this
1)
Window > Preferences > General > Content Types, set UTF-8 as the default encoding for all content types.2)
Window > Preferences > General > Workspace, setText file encodingtoOther : UTF-8
6 Comments
Properties'. The first entry Resource' offers exactly what you want.You can set a default encoding-set whenever you run eclipse.exe.
- Open eclipse.ini in your eclipse home directory Or STS.ini in case of STS(Spring Tool Suite)
- put the line below at the end of the file
-Dfile.encoding=UTF-8
2 Comments
Just right click the Project -- Properties and select Resource on the left side menu.
You can now change the Text-file encoding to whatever you wish.
1 Comment
Right click on main source -> Run As -> Run Configurations -> (x)= Arguments -> VM arguments -> add:
-Dsun.stdout.encoding=UTF-8 1 Comment
If you have Windows 11, and none of the previous answers worked, you could need to change your Region settings. Follow these steps:
Quick instructions:
Windows search > Control Panel > Region > Administrative tab > Change system locale... > check Beta: Use Unicode UTF-8 for worldwide language support > OK > Restart now
Full instructions:
- Go to the Windows search: Press the
Winkey, or just click on theSearchbutton. Another way you can go is by pressing theWin+sshortcut. - Type Control Panel and press
enterkey to open it, or simply click on the first search result. - Click on the
View bydropdown menu in the upper right corner and selectCategory(if the view is not set by Category). - Go to
Clock and Region. - Click on
Region. - Go to the
Administrativetab. - In Language for non-Unicode programs, click on
Change system locale...button. - Check the
Beta: Use Unicode UTF-8 for worldwide language supportoption. - Click
OK. - Click
Restart now.
You should be able to see the characters properly in Eclipse.
Comments
You can set an explicit Java default character encoding operating system-wide by setting the environment variable JAVA_TOOL_OPTIONS with the value -Dfile.encoding="UTF-8". Next time you start Eclipse, it should adhere to UTF-8 as the default character set.
See https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html
Comments
I tried all settings mentioned in this post to build my project successfully however that didn't work for me. At last I was able to build my project successfully with mvn -DargLine=-Dfile.encoding=UTF-8 clean install command.

