4

I am trying to setup intellij with scala and sbt for development. I have already installed scala and SBT plugins on the IDE. However, when I try to create a new scala and sbt project, the build.sbt file shows the following errors:

Cannot resolve symbol :=
Cannot resolve symbol name
Cannot resolve symbol version
Cannot resolve symbol scalaVersion

Here is my build.sbt file which was created by the IDE itself:

name := "setup"

version := "1.0"

scalaVersion := "2.12.2"

The following are the steps I followed for creating the project:

Step One: File -> New Project

Step Two: Choose Scala from the left hand side panel and choose SBT on the right hand side panel (i.e SBT-based Scala project) and click Next.

Step Three: Fill in the project details and click Finish. ( Scala version -> 2.12.2, SBT version -> 0.13.13)

IntelliJ version - IntelliJ IDEA 2017.1.3

Edit:

Whenever I am trying to create a new project, I get the following error :

Error:Error while importing SBT project:<br/>...<br/><pre>    https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: org.fusesource.jansi#jansi;1.11: not found

        ::::::::::::::::::::::::::::::::::::::::::::::



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.fusesource.jansi#jansi;1.11: not found
Error during sbt execution: Error retrieving required libraries
  (see C:\Users\xxxxxx\.sbt\boot\update.log for complete log)
Error: Could not retrieve jansi 1.11
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0</pre><br/>See complete log in <a href="C:\Users\xxxxx\.IntelliJIdea2016.2\system\log\sbt.last.log">C:\Users\xxxxx\.IntelliJIdea2016.2\system\log\sbt.last.log</a>

the Log file has the following content:

Getting org.fusesource.jansi jansi 1.11 ...
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
:: problems summary ::
:::: WARNINGS
    Host jcenter.bintray.com not found. url=https://jcenter.bintray.com/org/fusesource/jansi/jansi/1.11/jansi-1.11.pom
    Host jcenter.bintray.com not found. url=https://jcenter.bintray.com/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar
    Host repo.typesafe.com not found. url=https://repo.typesafe.com/typesafe/ivy-releases/org.fusesource.jansi/jansi/1.11/ivys/ivy.xml
    Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/

** So I think this is an issue with my proxy settings and I definitely need to use the proxy. Is there a way to solve this??

Any help would be appreciated. Thank you.

Hemanth Annavarapu
  • 823
  • 3
  • 19
  • 37
  • 2
    You don't need SBT plug-in for IntelliJ IDEA. This functionality is already included into the Scala plug-in. Use Import on the Welcome screen and point to the existing build.sbt file. – CrazyCoder May 23 '17 at 21:00
  • Go to src/main/scala and create a empty scala class. It should either prompt you to specify a scala installation or should trigger a project refresh. You can also click on the right sbt tab and refresh all projects. – Steffen Schmitz May 23 '17 at 22:43
  • 1
    Thanks for the comment. But I can't find the option of creating a new scala class when I right click on the scala folder in src. I think I am having problem with downloading the required libraries. Not sure if I am right though. – Hemanth Annavarapu May 24 '17 at 03:22
  • In step 3 are you selecting a JDK? – Tanjin May 24 '17 at 04:00
  • what version of JDK and scala are you using ? – koiralo May 24 '17 at 05:43
  • You can also have a look at this question. It provides some ideas on how to get started with sbt and intellij: https://stackoverflow.com/questions/4250318/how-to-create-sbt-project-with-intellij-idea?rq=1 – Steffen Schmitz May 24 '17 at 06:23
  • @Tanjin yes, I am selecting a JDK, JDK 1.8 – Hemanth Annavarapu May 24 '17 at 12:12
  • @Shankar JDK 1.8 and Scala 2.12.2 – Hemanth Annavarapu May 24 '17 at 12:13
  • have you configured a proxy in the IDEA settings? does the resolving work if you start sbt from the command line? – Justin Kaeser May 25 '17 at 18:11
  • Yes, I have configured my proxy in the settings and the connection seems to work fine as well. I haven't tried to start sbt from the command line, can you please tell me how to do that? – Hemanth Annavarapu May 25 '17 at 18:24
  • Install sbt for windows: https://github.com/sbt/sbt/releases/download/v0.13.15/sbt-0.13.15.msi then on the command prompt type `sbt` – Justin Kaeser May 29 '17 at 11:06

0 Answers0