在带有 Play 2.0 项目的 Intellij IDEA 11 中找不到 Scala 编译器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10407777/
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
Scala Compiler not found in Intellij IDEA 11 with Play 2.0 project
提问by Sean Freitag
I created a project using the typical play new, and then I used play ideato generate the .iml file. When I imported the .iml file into Intellij IDEA, I could not figure out how to get the compiler library to recognize. Below are some screenshots:
我使用典型的创建了一个项目play new,然后我用来play idea生成 .iml 文件。当我将 .iml 文件导入 Intellij IDEA 时,我无法弄清楚如何让编译器库进行识别。下面是一些截图:




Please help!
请帮忙!
回答by Chris B
This is a slight weirdness with the Scala settings in IntelliJ. Currently the only way to register a scala distribution is to create a new project.
IntelliJ 中的 Scala 设置有点奇怪。目前注册 Scala 发行版的唯一方法是创建一个新项目。
Steps:
脚步:
File > New Project > Create project from scratch
Leave all settings as default. Project name can be anything.
On the "Please select the desired technologies" page, choose Scala. Some GUI elements will appear that allow you to tell IntelliJ how to find your scala compiler and library. Make sure to set the "Level" options to "global".
Click Finish. Close the dummy project that you created, and go back to your real project. The Scala compiler that you registered should now be in the list on your project settings page.
文件 > 新建项目 > 从头开始创建项目
将所有设置保留为默认值。项目名称可以是任何东西。
在“请选择所需的技术”页面上,选择 Scala。将出现一些 GUI 元素,允许您告诉 IntelliJ 如何找到您的 Scala 编译器和库。确保将“级别”选项设置为“全局”。
单击完成。关闭您创建的虚拟项目,然后返回到您的真实项目。您注册的 Scala 编译器现在应该在您的项目设置页面的列表中。
回答by Keeth
A variation that worked for me: drop the Scala facet and run 'Add framework support...' again.
对我有用的变体:删除 Scala 方面并再次运行“添加框架支持...”。
File / Project Structure / Facets
Click Scala facet then minus to remove Scala facet from your module. Click OK.
Right click your project/module, 'Add Framework Support...', choose Scala.
Enter the path to your Scala compiler and library.
文件/项目结构/方面
单击 Scala facet,然后单击减号以从您的模块中删除 Scala facet。单击确定。
右键单击您的项目/模块,“添加框架支持...”,选择 Scala。
输入 Scala 编译器和库的路径。
回答by rintcius
I also ran into this problem, but the workaround as described by Chris B did not work for me, since in my case "Scala" was missing on the "Please select the desired technologies" page.
我也遇到了这个问题,但是 Chris B 描述的解决方法对我不起作用,因为在我的情况下,“请选择所需的技术”页面上缺少“Scala”。
In my case the problem appeared to be an incompatible Scala plugin. After I reinstalled the Scala plugin it worked fine.
就我而言,问题似乎是不兼容的 Scala 插件。在我重新安装 Scala 插件后,它运行良好。

