上QQ阅读APP看书,第一时间看更新
Installing IntelliJ IDEA
Go to https://www.jetbrains.com/idea/download. Download the community edition for your platform. The ultimate edition offers more features, but we will not use them in this book.
The following are the steps to install IntelliJ IDEA:
- Run IntelliJ Idea.
- Select the Do not import settings option:
Choose a UI theme. I personally prefer Dracula, since a dark background saves battery on a laptop and is more gentle on the eyes:
Create a desktop entry by checking the options given:
- In the Create Launcher Script dialog window, check the create a script... checkbox. It will let you open files in IntelliJ from the command line:
- Customize the plugins. For each component, click on Customize... or Disable All. We will not need most of the plugins. You can only select the following:
- Build Tools: Disable All.
- Version Controls: Only keep Git and GitHub.
- Test Tools: Disable All.
- Swing: Disable.
- Android: Disable.
- Other Tools: Disable All and keep Bytecode viewer, Terminal, and YAML.
- Plugin Development: Disable.
You can see the aforementioned plugins in the following screenshot:
- Install the featured plugins—some additional plugins are proposed for you to install, such as the Scala plugin and a tool to learn the essential features of IntelliJ.
- Click on the Install button for Scala and for the IDE Features Trainer, as shown in the following screenshot, and then proceed by clicking on Start using IntelliJ IDEA:
If you are already a Vim aficionado, you can install IdeaVim . Otherwise, I would recommend that you avoid it. I personally use it daily, but it took me some time to get used to it.
- Click on Create New Project | Scala | sbt:
- Fill in the following details, as shown in the following screenshot:
- Name: scala_fundamentals.
- JDK: Click on New and then select the installation directory of the Oracle JDK.
- sbt: Choose the version 1.0.4, check Sources.
- Scala: Choose the latest version 2.12.x, for instance 2.12.4 (IntelliJ lists all the possible versions and will download the one you choose), and check Sources.
- Click on Finish.
It is going to take some time depending on your internet connection's speed:
- You should see the following project structure: