Step 2: Configure the Java Development Kit (JDK)
- Locate Your JDK Installation1:
- If you already have the JDK installed, note its installation path (e.g.,
C:\Program Files\Java\jdk-xx.x.x
). If not, Go to the Oracle JDK download page: Oracle JDK Download.
- If you already have the JDK installed, note its installation path (e.g.,
- Set up JDK in IntelliJ IDEA1:
- Open IntelliJ IDEA.
- Go to File > Project Structure > SDKs.
- Click the + icon and select “Add JDK”.
- Browse to your JDK installation directory and select it.
- Click “OK”.
- Apply the changes.
(if JDK is not automatically detected)
Sometimes, IntelliJ IDEA may not automatically detect the JDK. In that case, you need to set up environment variables manually.
- Open System Properties
- Search for “Environment Variables” in the Start menu and select “Edit the system environment variables”.
- Click “Environment Variables…” at the bottom of the System Properties window.
- Set JAVA_HOME
- Under “System variables”, click “New…”.
- Variable name:
JAVA_HOME
- Variable value: The path to your JDK installation directory (e.g.,
C:\Program Files\Java\jdk-xx.x.x
) - Click “OK”.
- Edit the Path Variable
- Find the “Path” variable in the System variables list, select it, and click “Edit…”.
- Click “New” and add
%JAVA_HOME%\bin
to the list. - Click “OK” to close all windows.
- Verify the Configuration
- Open Command Prompt (search for “cmd” in the Start menu).
- Type
java -version
and press Enter. You should see the installed Java version information. If it shows an error, double-check your environment variables.