Question

I am working on a simple project in Eclipse in Scala-IDE. The project makes use of someone else's library (which comes in *.java source files, not in a .jar). The library source files contain numerous comments in Japaneese. I cannot compile the Scala project since for every such file I get an error like this one:

IO error while decoding D:\path\FileName.java with windows-1252 Please try specifying another one using the -encoding option

Seems like I did not have this problem when the project was in Java. Now I am migrating to Scala and that is what I am getting.. I do not want to delete all these comments, is there any way to make the compiler handle them? I have tried all kinds of encoding fixes starting from Preferences->Resources->Text file encoding and ending with eclipse.ini file encoding parameters...

Was it helpful?

Solution 2

I have resolved the issue. The Scala compiler has a different set of options that likely does not subdue to the global Eclipse options. So by going to Preferences->Scala->Compiler and adding -Dfile.encoding=UTF-8 to the Additional command line parameters field I have fixed the error.

OTHER TIPS

I had a similar issue after I switched from linux to macosx

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

(Eclipse Juno)

  1. Open the preferences
  2. General - Workspace
  3. Switch "text file encoding" to "UTF-8"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top