5

I wrote a simple Test case in IntelliJ 2017.1 Ultimate. And I see an absolutely bogus error message in IntelliJ

class must either be declared abstract or implement convertToLegacyCheckingEqualizer

My code compiles and runs absolutely fine but IntelliJ edition always shows this message for each and every test class.

I googled and found totally unsatisfactory answers like

* I restarted my IDE to solve the problem
* I deleted my idea project and recreated it to solve the problem
* I cleared ivy cache to solve the problem.

This solutions are just wrong and don't really address the problem.

enter image description here

Knows Not Much
  • 30,395
  • 60
  • 197
  • 373
  • 1
    Can you post a simple, one-class project that illustrates the problem? Are your using _SBT_? Are your using the _IntelliJ Scala_ plugin (I'm assuming you are, but it's not obvious from your question.) Without seeing the definition of your code, and your _IntelliJ_ configuration, it's impossible to help you. – Mike Allen Jul 18 '17 at 06:26
  • I took a screenshot of the problem. Yes I am using SBT and Scala Plugin. – Knows Not Much Jul 18 '17 at 08:47

1 Answers1

8

Give this a try: in IntelliJ, go to the File menu, then select the Invalidate Caches / Restart... option. On the resulting dialog, click the Invalidate and Restart button.

After IntelliJ has restarted, check whether you still have the same problem.

Mike Allen
  • 8,139
  • 2
  • 24
  • 46
  • After IntelliJ restarts, I still have the same problem :-( – Fried Brice Mar 13 '18 at 16:47
  • 2
    @FriedBrice It might pay to run `sbt clean` (exit from _IntelliJ_ first, and run this from the command line), then invalidate the caches in _IntelliJ_ a second time. If that fails, it might also be necessary to clear your _Ivy_ cache as well, then repeat these steps once more. – Mike Allen Mar 13 '18 at 17:08
  • 1
    Deleted ~/.m2, ~/.sbt, ~/.ivy2, ~/.scalac, and deleted and recloned project directory. Same problem :-( I'll continue googling. Thanks for the help, @MikeAllen :-) – Fried Brice Mar 13 '18 at 17:57
  • 8
    Thanks for your help and patience. I eventually found that the problem was a missing JDK. I upgraded my system JDK and deleted the old one without changing it in the project settings. Changing it in the project settings made everything work :-) – Fried Brice Mar 16 '18 at 07:02
  • @FriedBrice Hmmm. That's good to know! In case it helps anyone else, what were the versions of the JDK that you had, and that you were missing? – Mike Allen Mar 16 '18 at 11:07
  • 3
    It was 1.8.0_15x, and it's not 1.8.0_162. A `brew upgrade` brought in the new version of Java, and my Project Structure in IntelliJ was incorrectly configured to point to the literal 1.8.0_15x dir instead of using my JAVA_HOME environment variable. I set it to use JAVA_HOME so future upgrades won't break my projects. – Fried Brice Mar 16 '18 at 15:45