Skip to content

Instantly share code, notes, and snippets.

@satorg
Last active March 20, 2022 09:05
Show Gist options
  • Save satorg/5e517e0c8922335405f0a3a69664cab4 to your computer and use it in GitHub Desktop.
Save satorg/5e517e0c8922335405f0a3a69664cab4 to your computer and use it in GitHub Desktop.
HOWTO FIX: "Warning:scalac: Cannot connect to compile server at localhost/127.0.0.1:3200 Trying to compile without it"

Applicable for:

  • IntelliJ IDEA CE 2019.1 (2018.* – ?)
  • macOS Mojave
  • may also work for other IDEA/macOS versions

Steps to fix:

  1. Go to directory ~/Library/Preferences/IdeaIC${IDEA_VERSION}/
    • for IntelliJ IDEA CE 2019.1: ~/Library/Preferences/IdeaIC2019.1/.
  2. There're two files in this directory:
    • ./settingsRepository/repository/scala.xml;
    • ./options/scala.xml.
  3. Ensure both files have the same value for the COMPILE_SERVER_PORT option (if some file lacks this option, add it):
    • for example: <option name="COMPILE_SERVER_PORT" value="3200" />;
    • COMPILE_SERVER_PORT can take any valid free port number;
    • perhaps other options in these two files should have same values as well.
  4. Restart your IntelliJ IDEA (not sure if it's necessary, but I'd suggest to).
@polymorphic
Copy link

Confirmed for macOS Catalina and IntelliJ IDEA 2020.3 👍

@JannikArndt
Copy link

For IntelliJ IDEA, the path is ~/Library/Application Support/JetBrains/IntelliJIdea2021.1/settingsRepository/repository/scala.xml.

To debug, you can run lsof -PiTCP -sTCP:LISTEN to list open ports. You should see one spawned by java on localhost:3200.

@satorg
Copy link
Author

satorg commented Aug 9, 2021

On my current macOS Big Sur and IntelliJ IDEA 2021.2 Community Edition there's only
~/Library/Application Support/JetBrains/IdeaIC2021.2/options/scala.xml
and no settingsRepository directory at all.
But the compile server seems to be working correctly nevertheless.
Hopefully, they fixed it up eventually.

@mqshen
Copy link

mqshen commented Mar 15, 2022

On my current macOS Big Sur and IntelliJ IDEA 2021.2 Community Edition there's only ~/Library/Application Support/JetBrains/IdeaIC2021.2/options/scala.xml and no settingsRepository directory at all. But the compile server seems to be working correctly nevertheless. Hopefully, they fixed it up eventually.

Set the project SDK to java 8 fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment