If you’re getting started with Java, Kotlin, or Android development, setting up the right tools is your first step. In this guide, I’ll walk you through how to install the JDK and configure IntelliJ IDEA for both general JVM development and Android projects.
Step 1: Install the JDK
The Java Development Kit (JDK) is required to compile and run Java code. IntelliJ also needs it for many of its features.
1. Choose Your JDK Version
For most projects:
- JDK 17 is the current LTS (Long-Term Support) version.
- JDK 11 is also widely supported if you’re using older tools.
You can download OpenJDK from:
2. Install the JDK
- Windows/Mac: Run the installer and follow the prompts.
- Linux: Use your package manager (
sudo apt install openjdk-17-jdk
for Ubuntu, for example).
3. Set the JAVA_HOME
Environment Variable
This helps IntelliJ and Android Studio find your JDK.
- Windows:
Search for “Environment Variables” → Add a new system variable:JAVA_HOME = C:\Program Files\Java\jdk-17
- macOS/Linux:
Add this to your.bashrc
,.zshrc
, or.profile
:export JAVA_HOME=$(/usr/libexec/java_home -v 17) export PATH=$JAVA_HOME/bin:$PATH
Step 2: Install IntelliJ IDEA
1. Download IntelliJ
Go to JetBrains IntelliJ IDEA and choose:
- Community Edition (free) — great for JVM development.
- Ultimate Edition (paid) — includes tools for web, enterprise, and database development.
2. Install and Run IntelliJ
- Follow the installer instructions for your OS.
- On first launch, IntelliJ will ask for your settings. You can import previous settings or start fresh.
Step 3: Configure IntelliJ for JVM Development
1. Set the JDK
- Go to File → Project Structure → Project.
- Set Project SDK to the JDK you installed.
- If it’s not listed, click Add SDK → JDK and navigate to your JDK folder.
2. Create a New Java or Kotlin Project
- Use File → New → Project.
- Choose Java or Kotlin, and select your JDK.
You’re now set up for JVM-based development!
Step 4: Set Up Android Development (Optional)
If you’re building Android apps, you’ll need additional tools.
1. Install Android SDK and Tools
Use Android Studio for this part — it handles SDKs, emulators, and build tools. Get it here:
https://developer.android.com/studio
After setup:
- You can import Android projects into IntelliJ.
- Or use IntelliJ Ultimate (which has better Android support than Community Edition, but Android Studio is still preferred).
2. Configure the Android SDK in IntelliJ
- Go to File → Project Structure → SDKs → Add Android SDK.
- Point it to the location where Android Studio installed the SDK, usually:
~/Library/Android/sdk
on macOSC:\Users\<your-username>\AppData\Local\Android\Sdk
on Windows
Final Tips
- Keep your SDKs and tools up to date.
- Use Gradle or Maven for managing dependencies.
- Use version control early (Git + GitHub/Bitbucket).
Once you’re set up, you can build anything from simple Java apps to complex Android projects.
Need help picking a build tool or organizing your first project? Let me know in the comments.
Leave a Reply