Install Java 25 (JDK) and IntelliJ IDEA, Then Run Your First Program
Install JDK 25 (Microsoft Build of OpenJDK) with JAVA_HOME, install IntelliJ IDEA, then point a run configuration at the JDK and the main class and run Hello World.
What you will learn
- Download and install the Microsoft Build of OpenJDK 25 with JAVA_HOME set
- Install IntelliJ IDEA and open a lecture project folder
- Fix 'Project JDK is not defined' with a run configuration
- Run a Hello World class and read the exit code
Before you start
- A Windows, macOS or Linux computer
- No Java experience needed
You need two tools for every Java lesson: Java itself (the JDK) and an editor to write and run code in, IntelliJ IDEA. You install both once. After that, every lesson is just "open the project and run it".
Here's the plan:
- Install JDK 25, the Microsoft build.
- Install IntelliJ IDEA.
- Open a small Java project, tell IntelliJ which JDK to use, and run it.
Step 1: download JDK 25
JDK stands for Java Development Kit. It holds the compiler and the runtime that run your programs. We'll use the Microsoft Build of OpenJDK 25.
- Search for java download microsoft and open the Microsoft Learn result, "Download the Microsoft Build of OpenJDK".
- Check the address bar. You should be on
learn.microsoft.com/java/openjdk/download, the official page. - Scroll to the table for OpenJDK 25. Each operating system has its own row. On a normal 64-bit Windows machine, take the
.exefile. On a Mac or Linux, pick your own row.
Step 1: install JDK 25
Run the downloaded file and go through the screens:
- Install mode: choose "install for all users", the recommended option.
- License: accept it and click Next.
- Destination folder: keep the default. It goes inside
Program Files\Microsoft, in a JDK 25 folder whose name starts withjdk-25and includes the exact version. Remember this location; you'll need it in step 3. - Custom setup: this is the screen that matters. Tick the option that sets the
JAVA_HOMEenvironment variable, and keep the PATH option ticked.
JAVA_HOME is how your tools (IntelliJ, Maven and friends) find out where Java is installed. Click Next, then Install. It takes a minute or so. Click Finish and Java is on your machine.
Step 2: download and install IntelliJ IDEA
Search for intellij download and open the JetBrains result at jetbrains.com/idea/download. The page in the lecture showed version 2026.3. Pick the tab for your operating system and click Download. On Windows it's an .exe, and it's a big file, so give it a little time.
Run the installer:
- On the installation options, tick a desktop shortcut, Add "Open Folder as Project" and the
.javaassociation. They are optional, but "Open Folder as Project" is handy for the lesson project files. - Keep JetBrains as the start menu folder and click Install.
Open IntelliJ from the desktop. The first start shows a splash screen for a few seconds, then the home screen. Under Projects there's an Open button, which is what you use next. The UI can look a little different in later versions, but the steps stay the same.
If you want the paid edition, you can get a free 6-month IntelliJ IDEA licence with the StudyEasy coupon.
Step 3: open a project and run it
On the home screen, click Open, pick the lecture's project folder and click Select Folder. The lecture uses a small Hello World project.
You may see a banner at the top of the editor: Project JDK is not defined. IntelliJ doesn't know which Java to use yet. You could fix it from the banner with "Setup SDK", but a run configuration does the job and it's how IntelliJ runs a program anyway.
Create the run configuration
- Open the drop-down at the top that says Current File and click Edit Configurations.
- Click + and pick Application. That's the type for a plain Java class with a
mainmethod. - Three things need filling in: a name, the JDK and the main class. Right now the JDK box says "module not specified" and the main class is empty, which is why the form shows red.
Pick the JDK and the main class
- Open the JDK box and choose Select alternative JRE. Browse to
C:\Program Files\Microsoft, pick the JDK 25 folder and click Select Folder. - Name the configuration
HelloWorld. - In Main class, type the full class name,
org.studyeasy.helloworld.HelloWorld. You can also click the small icon at the end of the field and pick the class from a list. - Click OK. The toolbar now shows HelloWorld, your configuration. Click the green Run button next to it.
The Run window shows:
Hello World
Process finished with exit code 0
Exit code 0 means the program ended normally. Everything works.
Common mistakes
- Skipping the JAVA_HOME option. Java still installs, but other tools can't find it. If that happens, re-run the installer and tick it.
- Downloading from a random mirror. Check that the address is
learn.microsoft.comfor the JDK andjetbrains.comfor IntelliJ. - Typing only the class name. The main class field needs the full name with the package:
org.studyeasy.helloworld.HelloWorld, notHelloWorld. - Picking the wrong folder for the JDK. Select the JDK 25 folder itself, not
Program Files\Microsoftabove it.
Recap
| Step | What you do | How often |
|---|---|---|
| JDK 25 | Install the Microsoft Build of OpenJDK with JAVA_HOME and PATH ticked | Once |
| IntelliJ IDEA | Install from jetbrains.com, open the project folder | Once |
| Run configuration | Application type, the JDK 25 folder, the full main class name | Per project |
| Run | Green Run button, look for exit code 0 | Every time |
Next, you'll create a project from scratch and see what the JDK and Maven each do in Hello World with Maven and the JDK.
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
FULL STACK JAVA : JAVA + JSP + SPRING BOOT AI + REACT + VIBE
Java 25, JSP, Hibernate, Spring Boot 4, REST APIs, React and Spring AI.View on Udemy ↗: FULL STACK JAVA : JAVA + JSP + SPRING BOOT AI + REACT + VIBE (paid course, opens in a new tab)Related posts
Use Claude Agent, Copilot or Junie Inside IntelliJ IDEA
Open IntelliJ's AI Chat, pick Claude Agent (the agent behind Claude Code) or Copilot and a model, ask in plain words for Main.java to print the date and time, review the change, and run it.
Java Hello World with Maven: What the JDK Does and What Maven Adds
javac compiles HelloWorld.java into bytecode and java runs it on the JVM. Maven adds one pom.xml, the same folders in every project and one build command. Then a real Maven Hello World in IntelliJ.
Java Variables, Keywords and Naming Rules
A variable is a labelled jar that holds one value at a time. Four small programs show declaring, reassigning, the names Java accepts, the keywords it reserves, and why daysUntilLaunch beats d.
Maven in IntelliJ: pom.xml, Dependencies and the Build Lifecycle
Open a plain project and a Maven project in IntelliJ, read an invoice app's pom.xml, follow jackson-databind from Maven Central into ~/.m2, and see why each lifecycle phase runs the ones before it.
