Nikhil
Nikhil

Reputation: 11

Facing issue while trying to enable source code in IntelliJ for scala

I am new to Scala programming and I have just started with basic programs in scala in IntelliJ IDE.

When i use the below code

package com.allaboutscala.chapter.one.tutorial_04

object HelloWorld extends App{ println("hello from hello world")

}

I wanted to see the source code of App where it uses the main method, but when i tries to see the source code and when I try to download it, I am getting error like Sources not found: Sources for 'scala-library.jar' not found. I have attached the screenshot also.It would be great if someone could guide me here.

enter image description here

Upvotes: 1

Views: 62

Answers (1)

Justin Kaeser
Justin Kaeser

Reputation: 5948

Since you are using sbt, you need to enable downloading of sources for your project:

  1. open IntelliJ Preferences
  2. search "sbt" or navigate to Preferences | Build, Execution, Deployment | Build Tools | sbt
  3. select "Download: library sources"
  4. refresh the sbt project

Upvotes: 0

Related Questions