简体   繁体   English

IntelliJ IDEA w / Scala插件没有找到scala.concurrent

[英]IntelliJ IDEA w/ Scala Plugin not finding scala.concurrent

I am having the hardest time getting a fresh install of IntelliJ to work properly with Scala. 我正在努力让全新安装的IntelliJ与Scala一起正常工作。

I've installed IntelliJ IDEA 13.1.4 and the Scala plugin on a Mac. 我在Mac上安装了IntelliJ IDEA 13.1.4和Scala插件。 In any project, the IDE complains it cannot find scala.concurrent (or any other package in scala-library) even though the library is listed under "External Libraries". 在任何项目中,IDE都会抱怨它找不到scala.concurrent(或scala-library中的任何其他包),即使该库列在“外部库”下。 What am I missing? 我错过了什么?

I've got the basic steps to reproduce down to: 我已经有了重现的基本步骤:

  1. Install IntelliJ IDEA 13.1.4 安装IntelliJ IDEA 13.1.4
  2. Install Scala plugin via IntelliJ plugins dialog 通过IntelliJ插件对话框安装Scala插件
  3. Create a new Scala project (either SBT or non-SBT, doesn't matter) 创建一个新的Scala项目(SBT或非SBT,无所谓)
  4. Define a new class and try to import scala.concurrent._ 定义一个新类并尝试导入scala.concurrent._

IntelliJ IDEA无法解析符号并发

This happens with new or existing projects - even when provisioned via sbt gen-idea . 这种情况发生在新的或现有的项目中 - 即使是通过sbt gen-idea

I've installed Scala and SBT via brew and even tried setting $SCALA_HOME to point to the brew install of scala ( /usr/local/share/scala ). 我已经通过brew安装了Scala和SBT,甚至尝试将$ SCALA_HOME设置为指向scala的brew安装( /usr/local/share/scala )。

IntelliJ is listing the library in External Libraries but still can't resolve the symbol. IntelliJ在外部库中列出库但仍无法解析符号。

IntelliJ IDEA列出了外部库中的scala-library

I have been fighting with this for hours. 我已经和它斗争了好几个小时。 What am I missing here? 我在这里错过了什么?

I had the same issue. 我遇到过同样的问题。 I fixed it with Invalidate Caches 我用Invalidate Caches修复它

File | 档案| Invalidate Caches / restart . 无效缓存/重新启动 Manual way on Mac with removing this folder: 在Mac上以手动方式删除此文件夹:

~/Library/Caches/IntelliJIDEAXX 〜/图书馆/缓存/ IntelliJIDEAXX

I had the same issue and above advice didn't help me. 我有同样的问题,上面的建议对我没有帮助。 After googling and reading JetBrains tickets, I found out that I had $JAVA_HOME variable pointing to JDK 1.7: JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home 在谷歌搜索和阅读JetBrains门票后,我发现我有$ JAVA_HOME变量指向JDK 1.7:JAVA_HOME = / Library / Java / JavaVirtualMachines / jdk1.7.0_45.jdk / Contents / Home

Removing that from both current shell ( unset JAVA_HOME ) and shell's profile (in my case .zshrc ) resolved the issue. 从当前shell(未unset JAVA_HOME )和shell的配置文件(在我的例子中.zshrc )中删除它解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM