0% found this document useful (0 votes)
4 views2 pages

IntelliJ Java Setup Guide

This document provides a step-by-step guide for setting up IntelliJ IDEA for Java development on macOS. It covers launching the application, creating a new project, understanding project structure, running applications, enabling auto-import features, and integrating with Git. Additionally, it includes shortcuts for productivity and suggests useful plugins to install.

Uploaded by

ss.xperia.sony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

IntelliJ Java Setup Guide

This document provides a step-by-step guide for setting up IntelliJ IDEA for Java development on macOS. It covers launching the application, creating a new project, understanding project structure, running applications, enabling auto-import features, and integrating with Git. Additionally, it includes shortcuts for productivity and suggests useful plugins to install.

Uploaded by

ss.xperia.sony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Setting Up IntelliJ IDEA for Java Development on macOS

Step 1: Launch IntelliJ IDEA


 Open IntelliJ IDEA from Launchpad or Applications.
 Choose theme, keymap, and enable recommended plugins during first-time setup.

Step 2: Create a New Java Project


 Click 'New Project'.
 Choose Language: Java, Build System: Maven or Gradle (Maven is recommended).
 Select JDK: If none is listed, click Add SDK > JDK and point to
/opt/homebrew/opt/openjdk.
 Click Next, name your project (e.g., HelloWorld), choose location, and click Finish.

Step 3: Understand the Project Structure


 src/main/java – Your Java source code.
 src/test/java – Your unit tests.
 pom.xml – Maven config file (if using Maven).
 build.gradle – Gradle config file (if using Gradle).

Step 4: Create Your First Java Class


 Right-click on src/main/java → New → Java Class.
 Name it Main.
 Add the following code:

Step 5: Run Your Application


 Right-click the file → Run Main.main().
 Or click the green triangle ▶ next to the main() method.

Step 6: Enable Auto Import & Save Features


 Go to Settings (Cmd + ,) → Editor → General → Auto Import.
 Enable 'Add unambiguous imports on the fly'.
 Go to Settings → Tools → Actions on Save → Check 'Reformat code' and 'Optimize
imports'.

Step 7: Add Maven Dependencies (Optional)


 Edit pom.xml to add dependencies. Example:

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>

Step 8: Terminal & Git Integration


 Use the built-in terminal (⌥F12) or from View → Tool Windows → Terminal.
 Version control: IntelliJ detects Git repos automatically, or use VCS → Enable Version
Control.

Step 9: Use Shortcuts to Be Productive


 Run: Ctrl + R (⌃R)
 Auto-import: Option + Enter (⌥Enter)
 Rename: Shift + F6 (⇧F6)
 Search class/file: Cmd + O / Shift + Cmd + O (⌘O / ⇧⌘O)
 Terminal: Option + F12 (⌥F12)
 Reformat code: Option + Cmd + L (⌥⌘L)

Step 10: Install Useful Plugins


 Go to Preferences → Plugins.
 Recommended: String Manipulation, Lombok, Rainbow Brackets, Key Promoter X, JUnit
Generator.

You might also like