3

I'm using IntelliJ IDEA 2017.3.4 as Scala IDE.

I have activate the "Build project automatically" option and set the Java 8 JDK as default project SDK. enter image description here

Bellow, the Scala compiler server configuration enter image description here

The Scala compiler server is running and listen on port 43558. I can't change this port, I think this is affected randomly by IntelliJ IDEA.

enter image description here

When I make modification of my Scala source code, the IntelliJ IDEA don't use the Scala Compiler Server to avoid recompile many classes on a little change. Due to this reason, compilation time is so long...

I got the error bellow: enter image description here

Warning:scalac: Cannot connect to compile server at localhost/127.0.0.1:3200
Trying to compile without it

Note: I'm running on Linux Host 64 bits (Arch Linux)

Have you any idea about what I need to do for using Scala compiler server?

JimyRyan
  • 359
  • 1
  • 2
  • 17

1 Answers1

0

I found a solution, I need to hard code the port of the Scala Compile Server

Edit file ~/.IntelliJIdea2017.3/config/options/scala.xml and add two options: COMPILE_SERVER_PORT and COMPILE_SERVER_MAXIMUM_HEAP_SIZE

Your file need to look like that content bellow:

<application>
  <component name="ScalaSettings">
    <option name="COMPILE_SERVER_PORT" value="43558" />
    <option name="COMPILE_SERVER_ID" value="xxxxxxx-xxxxx-xxxxxx-xxxxxxxxxx" />
    <option name="COMPILE_SERVER_SDK" value="1.8" />
    <option name="COMPILE_SERVER_MAXIMUM_HEAP_SIZE" value="2048" />
  </component>

Restart your IDE, you will be happy, It's working!

JimyRyan
  • 359
  • 1
  • 2
  • 17