无法在 Intellij IDEA 13 中配置 Scala
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20728836/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't configure Scala in Intellij IDEA 13
提问by VB_
I entered Scala courses on Coursera and used to write Scala projects in Eclipse Indigo. All worked well. But now I gonna to convert to my favorite IDE - Intellij IDEA.
我在 Coursera 上学习了 Scala 课程,并且曾经用Eclipse Indigo. 一切都很好。但现在我要转换为我最喜欢的 IDE - Intellij IDEA。
But I can't configure it for Scala usage.
但我无法为 Scala 使用配置它。
What I've already done:
我已经做了什么:
- Install Scala, set system
SCALA_HOMEvariable - Install SBT
- Install Scala plugin on Intellij IDEA
- 安装 Scala,设置系统
SCALA_HOME变量 - 安装 SBT
- 在 Intellij IDEA 上安装 Scala 插件
What a problem:
有什么问题:
When I import coursera assignments, Intellij doesn't see some classes like
List,Arrayetc. For example, when I try to import it viaAlt+Enterkey it propose mejava.jang.reflect.Array,java.sql.Array,com.sun.xml....Array. So I can't import Scala Array withtailandheadmethods.When I try:
New Project->Scala Modulethe are to problems:a) When I choose
Set Scala Homeit complains that there are missing filesb) When I choose
Existent Librarythere is nothing to choose inCompiler/Standartfields.
当我导入 coursera 作业时,Intellij 看不到诸如
List、Array等的某些类。例如,当我尝试通过Alt+Enter密钥导入它时,它会建议我java.jang.reflect.Array,java.sql.Array,com.sun.xml....Array。所以我不能用tail和head方法导入 Scala 数组。当我尝试:
New Project->Scala Module问题:a) 当我选择
Set Scala Home它时,它抱怨缺少文件b) 当我选择时
Existent Library,在Compiler/Standart字段中没有任何选择。


Question:
问题:
How to configure Intellij properly?
如何正确配置 Intellij?
采纳答案by David Weinberg
Is the directory you specified the right one? It should have bin, doc, etc. in it. If so, try entering the following by hand:
您指定的目录是否正确?它应该有 bin、doc 等。如果是这样,请尝试手动输入以下内容:
For compiler library, scala-compiler
对于编译器库, scala-compiler
For standard library, scala-library
对于标准库, scala-library
IDEA found these for me automatically, but perhaps something went wrong for you.
IDEA 会自动为我找到这些,但也许您出了点问题。
回答by lukas
It can be a problem with caches, try File -> Invalidate Caches
缓存可能有问题,请尝试 File -> Invalidate Caches
回答by Dirk bachmann
Make sure to manually add the scala-libraryas a dependency to your module.
This is not done automatically when adding the Scala facet to an existing module.
确保将 手动添加scala-library为模块的依赖项。将 Scala 方面添加到现有模块时,这不会自动完成。

