简体   繁体   English

IntelliJ Idea 12工作表+ sbt + Scala —错误

[英]IntelliJ Idea 12 worksheet + sbt + Scala — error

When I run a worksheet in IntelliJ Idea 12 (sbt plugin, Scala project), I've got an error of: 当我在IntelliJ Idea 12(sbt插件,Scala项目)中运行工作表时,出现以下错误:

> Failed to initialize compiler: class scala.reflect.BeanInfo not found.
  ** Note that as of 2.8 scala does not assume use of the java classpath.
  ** For the old behavior pass -usejavacp to scala, or if using a Settings
  ** object programatically, settings.usejavacp.value = true.

Everything what has to be set up, is setup: sbt, dependencies, etc, that is if run this project using sbt command line (compile, run), it will run successfully. 必须设置的所有内容均已设置:sbt,依赖项等,也就是说,如果使用sbt命令行运行该项目(编译,运行),它将成功运行。

Of course, I ran sbt gen-idea . 当然,我运行了sbt gen-idea

What do I do? 我该怎么办?

My solution: 我的解决方案:

I created a new Scala project with IntelliJ IDEA and set the Scala home to the manually downloaded and unpacked Scala folder for Scala 2.10.2. 我使用IntelliJ IDEA创建了一个新的 Scala项目,并将Scala主页设置为手动下载并解压缩的Scala 2.10.2的Scala文件夹。

Now you can set the Scala compiler in the real project: Switch to the real project, open the project structure settings and then Modules | 现在,您可以在真实项目中设置Scala编译器:切换到真实项目,打开项目结构设置,然后单击“模块” |“模块”。 your module name | 您的模块名称| Scala | Scala | compiler library. 编译器库。 Switch to your new version. 切换到新版本。 Set the language level to 2.10. 将语言级别设置为2.10。

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

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