Sunday, 25 December 2011

Scala, Eclipse and Unicode operators

Problem

I usually write my programs using IntelliJ but since I heard so much good about Eclipse scala plugin I decided to give it a go. I imported the project into Eclipse and (surprise, surprise) it did not compile...

I quickly figured that it was a problem with unicode operators. First they weren't displaying well. Second they were not recognised by compiler either.

Solution

I quickly googled for an answer and here is what you need to do:
  1. Find your eclipse.ini file (on mac it's inside the app package in Contents/MacOS folder)
  2. Add this line -Dfile.encoding=UTF-8 at the end.
  3. Restart Eclipse
  4. Clean and rebuild the project

Here is how it looks after the fix:

Enjoy!

1 comment:

  1. Have you found a way to insert those characters in eclipse?

    ReplyDelete