Eclipse and Scala -IDE source files encoding an error?

I am working on a simple project in Eclipse in Scala -IDE. The project uses a different library (which is supplied in the *.java source files, and not in .jar ). The library source files contain numerous comments in Japaneese. I can not compile the Scala project, because for each such file I get an error similar to this:

I / O error while decoding D: \ path \ FileName.java with windows-1252. Try specifying another using -encoding

It seems that I did not have this problem when the project was in Java. Now I turn to Scala, and this is what I get. I don't want to delete all these comments, is there a way to get them to process them? I tried all kinds of coding fixes, starting with Preferences->Resources->Text file encoding and ending with the encoding parameters of the eclipse.ini file ...

+6
source share
2 answers

I solved the problem. The Scala compiler has a different set of parameters, which probably do not obey the Eclipse global parameters. Therefore, by going to Preferences → Scala → Compiler and adding -Dfile.encoding=UTF-8 to the Additional command line parameters field, I fixed the error.

+10
source

I had a similar problem after switching from linux to macosx

The default text file encoding Eclipse was set to US-ASCII to fix this:

(Eclipse Juno)

  • Open settings
  • General - Workspace
  • Switch "text file encoding" to "UTF-8"
+10
source

Source: https://habr.com/ru/post/907855/


All Articles