Getting Started with IntelliJ IDEA
Helpful tips for working with IntelliJ IDEA for the first time.
You can find more information on getting started with IntelliJ IDEA in our playlist on our YouTube channel.
Interested in JVM Development?
IntelliJ IDEA Welcome Screen
Get a project from source control, open an existing project, or create a new project.
The New Project Wizard helps you to create projects with different build systems and frameworks. There's more information in our screencast.
Interested in JVM Development?
Download a JDK
Download or Associate a JDK With Your Project.
You can use the New Project Wizard to configure existing JDKs, or download new ones from different vendors.
If the necessary JDK is already defined in IntelliJ IDEA, select it from the JDK list.
If the JDK is installed on your computer, but not defined in the IDE, select the option Add JDK from the list and specify the path to the JDK home directory (for example, /Library/Java/JavaVirtualMachines/jdk-21.0.2.jdk
).
If you don't have the necessary JDK on your computer, select Download JDK. In the Download JDK popup, specify the JDK vendor and version, change the installation path if required, and click Download.
Interested in JVM Development?
Create New Class
Quickly add new classes to your project.
Press ⌘1 (macOS) / Alt+1 (Windows/Linux), to open the Project Window and then use ⌘N (macOS) / Alt+Insert (Windows/Linux), to generate a new file.
These same shortcuts will help you in many places where you need to generate code, such as constructors, getters and setters, toString methods and adding arguments to methods when you need to refactor.
Navigate to Test
Go to your matching test class with one keyboard shortcut.
You can use ⌘⇧T (macOS) / Ctrl+Shift+T (Windows/Linux), to navigate to a test class and back again. IntelliJ IDEA will navigate to the related Test file, or suggest creating a test. It can even add some of the code constructs for the tests as well.
How to Search Everywhere in Any JetBrains IDE
Search for anything in your JetBrains IDE across Classes, Files, Symbols and Actions.
The Problem
How do I find stuff, without memorizing a bunch of stuff? You’re editing something. You want to jump to something in your project. The IDE has so many options. What’s the fastest way?
You could browse through the file tree to find the file. Similarly, activate the navigation bar and wander around. Lots of other choices: Recent Files, Recent Locations, bookmarks, keeping a thousand tabs open.
The Solution
Press ⇧⇧ (macOS) / Shift+Shift (Windows/Linux) for Search Everywhere. The one IDE entry point to find everything. Type a string, make a selection, and jump to the target.
To dismiss the popup, press Escape. You can jump to a file by putting in the name of a file, not something in the file. You can type parts of a file path, to save some time. Those tabs show the kinds of things that can be searched. Hit tab to go Classes, then again to go to Files.
Mouseover on the tabs to show key bindings to open directly. “Symbols” is a favorite. Actions…the next tip. Want more power? Here’s three bonus tips:
- This checkbox controls how widely Search Everywhere goes looking. Press ⇧⇧ (macOS) / Shift+Shift (Windows/Linux) again to toggle it to checked, then again to unchecked.
- Use filter… to restrict results by certain criteria, per-tab.
- Click Open in Find Tool Window to get the full find treatment.
Yes, you can resize this window, as if it was a normal window. Next time you use Search Everywhere, it will remember the dimensions. Last point: the footer area has…tips! As you can see from these, lots of power in Search Everywhere.
Here’s one you didn’t see coming: Search Everywhere is also a desktop calculator.
Search Everywhere is the perfect first thing. Super-easy to learn, immediately useful, and gradually scales to more power.
Run in Current Context
Run just a file or a single script.
Press ⌃⇧R (macOS) / Ctrl+Shift+F10 (Windows/Linux), to run the file in its current context.
Run your code with Docker, SSH or WSL
Set a Run Target to change where your code runs.
You can configure a Run Target of Docker, SSH or WSL for Java unit tests, Maven and Gradle projects, and for Spring Boot, Micronaut and Quarkus applications.
This means you can, for example, run Spring Boot applications with a Docker target.
Interested in JVM Development?
Commit Changes
Commit your changes to VCS as you go.
Use ⌘0 (macOS) / Alt+0 (Windows/Linux) to display the Commit tool window. Select the changes you want to commit. From here you can either click Commit to commit your changes locally, or Commit and Push to commit your changes and push them to the remote repository.
Alternatively, you can use ⌘K (macOS) / Ctrl+K (Windows/Linux) to open the Commit tool window with your changes already selected, or ⌘⌥K (macOS) / Ctrl+Shift+K (Windows/Linux) to commit and push your changes.
Interested in JVM Development?