IntelliJ setup
Software environment setup
NOTE – there is every chance this guide is slightly out-of-date. IntelliJ seems to update their UI once every few years.
Your TAs should be able to give you a better step by step tutorial in lecture.
From this lab on we will be using the IntelliJ Idea IDE (integrated development environment). This section describes how to set up a new project for this lab and the Java files you are expected to download or create.
- Apply for a free student account
- Once you go through the application process (use your @umn.edu address) you will get a link to your JetBrains Educational Pack webpage. On that page there’s a
Downloadoption. SelectDownload IntelliJ IDEA Ultimateto dowload IntelliJ
Alternatively, you can download IntelliJ at this link:
Once you have IntelliJ open go to Help \(\rightarrow\) Manage Subscriptions... and then click on Activate Another Subscription.... IntelliJ will prompt you to log onto your jetbrains student account.
Start IntelliJ and create a new Java Project
Begin by loading IntelliJ. Depending on your past use of intelliJ you may need to enter some one-time settings such as color theme and default set of keyboard shortcuts for IntelliJ.
You can set these options however you want, while I prefer default key-bindings and a light theme, many people may disagree, and it doesn’t effect your coding output one bit.
If you are not prompted for these settings, that too is fine. You can change these in the settings at your leisure.
Once open, depending on settings and past use IntelliJ will either open to it’s splash-screen or a previously opened project. Either way you want to make a new project.
If you are in a previous project go to File \(\rightarrow\) New \(\rightarrow\) Project.... Otherwise you can simply click the new project option.
The new project window should look something like this:
You want a Java project, with no additional library or framework support.
Make sure your project has a name (“Hello” would be appropriate for your first project). Make sure to check the project location. If necessary, update where the project is stored to keep your files well organized.
If you are working on your own computer don’t forget to check the Project SDK settings. You shouldn’t need to be using an SDK version 23, like shown in the screenshot, so long as you are using 9 or above, you should be fine.
If no SDK is listed, click new and setup your JDK. Typically IntelliJ will automatically open to your JDK (Java Development Kit) location.
- Click
create
If not shown, you will likely want to open the project view. The keyboard command for that is alt-1 on windows (and I believe this is true for Linux as well). This keyboard command is also shown in the background of the file viewer if no files are open.
First class
As a test that everything is working, let’s print Hello World!.
On IntelliJ go New \(\rightarrow\) Java Class. Name your file/class Hello.
In a main method (public static void main(String[] args)) call System.out.println with the string "Hello World!". This is what your Hello.java code should look like:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Click on the ▶ button at the top of your IntelliJ window will compile your class and run it.