简体   繁体   English

为Scala设置Intellij IDEA

[英]Setting up Intellij IDEA for Scala

Having tried the two other popular IDEs for this language, I decided that IntelliJ would work best for me. 在尝试使用其他两种流行的IDE来使用该语言后,我决定IntelliJ对我来说是最好的。 Still haven't managed to get it to work properly (eg getting the console running to test out new scripts, running a script from the IDE itself without create complicated project structures around it, etc.) and haven't found any descent tutorial for it. 仍然没有设法使其正常运行(例如,使控制台运行以测试新脚本,从IDE本身运行脚本而不在其周围创建复杂的项目结构等),也没有找到任何适用于此的下降教程它。 There were no problems in the installation and I have managed to get a simple "hello world" application to run (with a lot of additional overhead though). 安装没有问题,我设法运行了一个简单的“ hello world”应用程序(尽管有很多额外的开销)。 Is this what is expected from this IDE when running Scala? 这是运行Scala时从此IDE中获得的期望吗?

I have some experience with programming (Java, C#, R, and Matlab) and I've worked with Eclipse, Netbeans, and Visual Studio, but I never encountered so many issues with getting a language to run smoothly on an IDE (in the case of scala, it is actually simpler for me to write my scripts on Notepad++ and then run them through the command prompt, though it is a quite cumbersome process). 我有一些编程方面的经验(Java,C#,R和Matlab),并且曾经使用Eclipse,Netbeans和Visual Studio,但是我从未遇到过让语言在IDE上平稳运行的太多问题(在在使用Scala的情况下,实际上,对我来说,在Notepad ++上编写脚本,然后在命令提示符下运行它们,虽然比较麻烦,但实际上比较简单。 I'd appreciate any advice on this matter. 我很乐意就此事提出任何建议。

I'm using IntelliJ 14 and Scala 2.11.4 on a Windows 7 PC. 我在Windows 7 PC上使用IntelliJ 14和Scala 2.11.4。

From the IDEA (Scala and SBT plugins must be installed): Steps: 从IDEA(必须安装Scala和SBT插件):步骤:

Create Project -> Scala -> SBT -> (Choose scala version and SBT version) -> Finish! 创建项目-> Scala-> SBT->(选择scala版本和SBT版本)->完成!

That's all. 就这样。

From console: 从控制台:

cmd 
sbt
set name := "Poject name" 
set version := "0.1" 
set scalaVersion := "2.11.5"
session save 

Now it's possible to open it in IDEA. 现在可以在IDEA中打开它。

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

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