简体   繁体   English

使用Play 2.0项目在Intellij IDEA 11中找不到Scala编译器

[英]Scala Compiler not found in Intellij IDEA 11 with Play 2.0 project

I created a project using the typical play new , and then I used play idea to generate the .iml file. 我使用典型的play new创建了一个项目,然后我使用play idea生成.iml文件。 When I imported the .iml file into Intellij IDEA, I could not figure out how to get the compiler library to recognize. 当我将.iml文件导入Intellij IDEA时,我无法弄清楚如何让编译器库识别。 Below are some screenshots: 以下是一些截图:

在此输入图像描述

在此输入图像描述

Please help! 请帮忙!

This is a slight weirdness with the Scala settings in IntelliJ. 这与IntelliJ中的Scala设置略有不同。 Currently the only way to register a scala distribution is to create a new project. 目前,注册scala发行版的唯一方法是创建一个新项目。

Steps: 脚步:

  1. File > New Project > Create project from scratch 文件>新建项目>从头创建项目

  2. Leave all settings as default. 将所有设置保留为默认值。 Project name can be anything. 项目名称可以是任何内容。

  3. On the "Please select the desired technologies" page, choose Scala. 在“请选择所需技术”页面上,选择Scala。 Some GUI elements will appear that allow you to tell IntelliJ how to find your scala compiler and library. 将出现一些GUI元素,允许您告诉IntelliJ如何查找scala编译器和库。 Make sure to set the "Level" options to "global". 确保将“级别”选项设置为“全局”。

  4. 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编译器现在应该位于项目设置页面的列表中。

A variation that worked for me: drop the Scala facet and run 'Add framework support...' again. 一个适合我的变体:删除Scala方面并再次运行“添加框架支持...”。

  1. File / Project Structure / Facets 文件/项目结构/方面

  2. Click Scala facet then minus to remove Scala facet from your module. 单击Scala facet然后减去从模块中删除Scala facet。 Click OK. 单击确定。

  3. Right click your project/module, 'Add Framework Support...', choose Scala. 右键单击您的项目/模块,“添加框架支持...”,选择Scala。

  4. Enter the path to your Scala compiler and library. 输入Scala编译器和库的路径。

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. 在我的情况下,问题似乎是一个不兼容的Scala插件。 After I reinstalled the Scala plugin it worked fine. 我重新安装Scala插件后,它工作正常。

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

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