Install JetBrains IntelliJ IDE with Scala plugin

I recently formatted my machine and have cleanly installed Ubuntu 17.04. I was planning to install JetBrains IntelliJ with Scala plugin and below steps will show you how to do that.

1) Download IntelliJ Community Edition from https://www.jetbrains.com/idea/download. As of today, I’m downloading version: ideaIC-2017.1.2

2) Extract the tarball somewhere or say under /home/{yourhomefolder}/apps and switch to the ‘bin’ folder in a terminal.

3) Run ./idea.sh script and follow the installation instructions.

4) During install, if you see a window prompting you to ‘download and install Scala’, please do click on that or else we can still do it later. Once installation is completed, you will see the below screen.


5) Click on Configure > Plugins, then click on ‘Browse Repositories’ and finally search for ‘Scala’.

6) Make sure Scala, SBT and SBT Executor plugins are installed. Feel free to install anything else you wish to. Finally click close and you’ll be prompted to restart IntelliJ which will display main IntelliJ launch window again.

7) Click on ‘Create New Project’, select ‘Scala’ and choose ‘SBT’ as the build tool. Give your project a name and follow instructions.

8) Once IDE has loaded and all dependencies have been resolved, click on File > Project Structure > Modules and under the Sources tab, select ‘Sources’ which will tell IntelliJ to mark your entire Project as a source code. Finally click OK. More details – http://stackoverflow.com/questions/42027117/could-not-find-or-load-main-class-in-intellij/

9) Create a new ‘HelloWorld.scala’ file under src/main/scala folder. If you don’t see an option to create a scala file, then right click on your project, click on ‘Add Framework Support’, choose Scala framework and close the window. Now you should be able to create a scala file. More details – http://stackoverflow.com/questions/38006735/new-to-scala-unable-to-create-scala-class-on-intellij

10) Open HelloWorld.scala file, paste below code, press ALT + Shift + F10 to execute the script and you will see output shortly.

object HelloWorld{
def main(args:Array[String]):Unit={
println("Hello, world!")
}
}


leave your comment