This week I started the Coursera course Functional Programming Principles in Scala with Martin Odersky as instructor.
One of my first step was to have JetBrains IntelliJ IDEA working with the Scala programming language so that I can work on the course assignments using my preferred IDE.
I have seen that The Guardian published a blog post Functional Programming Principles in Scala: Setting up IntelliJ but it focus on the Unix-like operating systems (OSX and Linux). As I work on Windows I for sure installed it on my machine running Windows 8.1! I also use a different set of tools so here is the way I did it!
First of all I am assuming that you have JetBrains IntelliJ IDEA 12 and JDK installed.
From IntelliJ you need to install the Scala plugin so go to File / Settings then on the dialog search for plugins, click on Browse Repositories button and search for Scala then select Scala v.0.19.299 from JetBrains
Then you also need to install the SBT plugin also from JetBrains which is still in development and get nightly builds.
Add the following URL to the list of custom plugin repositories in Settings / Plugins / Browse Repositories / Manage Repositories:
After that, you may install the plugin via Settings | Plugins | Browse Repositories. IDEA will check for the latest plugin builds automatically.
Now extract the assignment zip that the coursera course is providing; e.g. for the example assignment, unpack the example.zip to a folder then in IntelliJ use File / Import Project. IntelliJ already recognize the folder as project:
Tick Use auto-import and click Finish. IntelliJ will then import your project:
Now you need to edit your project structure using File / Project Structure and choose Modules, then progfun-example
You will see on the dialog for the Source and Test Source Folders some folder in red, just click on the X to delete all the one in red to get to the following state, then finally click OK
Now navigate to the test file ListsSuite and press ALT – SHIFT – F10 to start the tests
And if you implemented the assignment you should see this results:
There is still two tests to fix in the first assignment, this is why there are red!
But as you can see now you have a full Scala development environment based on the great JetBrains IntelliJ IDEA IDE! Now you can code with pleasure!
I really enjoy the first week assignments and implemented the first two as coding Kata! And I even involved France-Anne for the second one; first time that she is coding something . Very nice!