How to install JDK 17 on Window 10 ,11
Installing JDK 17 on Windows 10 involves downloading the appropriate JDK distribution, installing it, and setting up the environment variables. Here's a step-by-step guide:
1. Download JDK 17
Go to the Oracle JDK website:
- Visit the Oracle JDK Downloads page.
- Alternatively, you can use open-source distributions like OpenJDK or Amazon Corretto.
Choose the Windows Installer:
- Select the
.exe
installer for Windows based on your system (x64 for 64-bit systems).
- Select the
Download:
- Click the download link and follow the instructions to save the file.
2. Install JDK 17
Run the Installer:
- Double-click the downloaded
.exe
file. - Follow the on-screen instructions to install JDK 17.
- Double-click the downloaded
Note the Installation Path:
- By default, the JDK is installed in
C:\Program Files\Java\jdk-17
.
- By default, the JDK is installed in
3. Set Up Environment Variables
Open System Properties:
- Press
Win + S
and search for "Environment Variables." - Select Edit the system environment variables.
- Press
Set
JAVA_HOME
:- In the System Properties dialog, click Environment Variables.
- Under System Variables, click New.
- Add:
- Variable Name:
JAVA_HOME
- Variable Value: The JDK installation path (e.g.,
C:\Program Files\Java\jdk-17
).
- Variable Name:
Update the
Path
Variable:- Find the
Path
variable under System Variables and click Edit. - Add a new entry:
%JAVA_HOME%\bin
.
- Find the
Save Changes:
- Click OK to close all dialog boxes.
4. Verify Installation
Open Command Prompt:
- Press
Win + R
, typecmd
, and press Enter.
- Press
Check the Version:
- Run the command:
- mvn -v
- It should display the JDK 17 version information.
Compile and Run a Test Program (Optional):
- Create a simple Java program,
Test.java
: - Compile:
javac Test.java
- Run:
java Test
- Create a simple Java program,
You're all set! Let me know if you encounter any issues.