How to Fix "Java is Not Recognized" and Set Up JDK 27
Published on
Have you ever tried to run a Java command in your terminal only to be met with the frustrating error message: "Java is not recognized as an internal or external command"?
This common issue occurs when the Java Development Kit (JDK) is either not installed or not properly configured in your system's environment variables. In this guide, we’ll walk through the step-by-step process of installing JDK 27 and setting it up correctly on Windows.
Watch the full youtube video tutorial:
Watch the full dailymotion video tutorial:
Step 1: Download the JDK
There are many flavors of Java available, including Oracle Java, IBM Java, and OpenJDK. For most projects, OpenJDK is an excellent choice.
- Search for "Java JDK download" in your browser.
- Select the version you need (in this case, JDK 27).
- Choose the Windows zip file and download it to your machine.
Step 2: Extract and Organize
Once the download is complete, you need to place the files in a permanent location on your local drive.
- Right-click the downloaded zip file and select Extract All.
- Navigate to your C: drive and create a folder named
SWD tools(Software Development Tools). - Copy and paste the extracted
JDK27folder into this new directory.
Step 3: Configure Environment Variables
This is the most critical step to ensure Windows knows where to find Java.
- Open the Start menu and search for "Environment Variables".
- Select Edit environment variables for your account.
- Under User Variables, click New:
- Variable Name:
JAVA_HOME - Variable Value:
C:\SWD tools\JDK27
- Variable Name:
- Locate the Path variable in the same list and click Edit.
- Click New and enter:
%JAVA_HOME%\bin - Click OK on all windows to save your changes.
Step 4: Verify the Installation
To confirm everything is working correctly, you must start a new command prompt session.
- Open a new Command Prompt (CMD).
- Type the following command:
java -versionIf successful, you will see the version details for JDK 27 instead of an error message!
C:\Users\moham>java --version
openjdk 27-ea 2026-09-15
OpenJDK Runtime Environment (build 27-ea+2-79)
OpenJDK 64-Bit Server VM (build 27-ea+2-79, mixed mode, sharing)
C:\Users\moham>
