Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't configure Scala in Intellij IDEA 13

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.

But I can't configure it for Scala usage.

What I've already done:

  1. Install Scala, set system SCALA_HOME variable
  2. Install SBT
  3. Install Scala plugin on Intellij IDEA

What a problem:

  1. When I import coursera assignments, Intellij doesn't see some classes like List, Array etc. For example, when I try to import it via Alt+Enter key it propose me java.jang.reflect.Array, java.sql.Array, com.sun.xml....Array. So I can't import Scala Array with tail and head methods.

  2. When I try: New Project -> Scala Module the are to problems:

    a) When I choose Set Scala Home it complains that there are missing files

    b) When I choose Existent Library there is nothing to choose in Compiler/Standart fields.

enter image description here

Question:

How to configure Intellij properly?

like image 254
VB_ Avatar asked Dec 22 '13 11:12

VB_


People also ask

How do I enable Scala in IntelliJ?

To install Scala plugin, press Ctrl+Alt+S , open the Plugins page, browse repositories to locate the Scala plugin, click Install and restart IntelliJ IDEA.

How do I change the Scala version in IntelliJ?

 In most cases your project JDK is not compatible with Scala or sbt version, try to change the Scala Compile Server SDK. Press Ctrl+Alt+S to open Settings/Preferences dialog. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.

How do I add Scala framework support in IntelliJ?

To add Scala support to existing module:Right-click the module in Project View, choose “Add Framework Support…” Check “Scala” in technologies list (unavailable if module has Scala facet attached) Provide a path to Scala installation (if not detected)

How to run a Scala project in IntelliJ IDEA?

1 Create or import a Scala project as you would normally create or import any other project in IntelliJ IDEA. 2 Open your application in the editor. 3 Press Shift+F10 to execute the application. Alternatively, in the left gutter of the editor, click the icon and select Run 'name'.

How do I keep track of error analysis in IntelliJ IDEA?

Also IntelliJ IDEA lets you keep track of error analysis based on the Scala type system using the Scala type-aware highlighting. By default, it is enabled and you can see the icon located at the bottom of the user interface.

Can IntelliJ IDEA select more than one piece of code?

IntelliJ IDEA can select more than one piece of code at a time. You can select next occurrence via Alt+J and deselect by pressing Alt+Shift+J. You can even select all occurrences at once, by pressing Ctrl+Alt+Shift+J. For more details, refer to Editor basics.

Is it possible to run tests in IntelliJ IDEA using sbt?

The Use UI with sbt option that displays the test results in the same format as for platform test runner is not available. IntelliJ IDEA lets you test scopes using ScalaTest or Specs2. You can run tests inside a scope or test the whole scope in your Scala projects.


2 Answers

It can be a problem with caches, try File -> Invalidate Caches

like image 145
lukas Avatar answered Oct 12 '22 05:10

lukas


Is the directory you specified the right one? It should have bin, doc, etc. in it. If so, try entering the following by hand:

For compiler library, scala-compiler

For standard library, scala-library

IDEA found these for me automatically, but perhaps something went wrong for you.

like image 24
David Weinberg Avatar answered Oct 12 '22 06:10

David Weinberg