Setting Java Path in Windows 11

0
3

Setting the Java path in Windows 11 is essential for running Java applications and development tools. This guide will walk you through the steps to set the Java path correctly.

Step 1: Download and Install Java

Download Java JDK Offline Installer for Windows x64bit PC
  1. Download Java: Visit the official Oracle website and download the Java Development Kit (JDK) for Windows.
  2. Install Java: Run the installer and follow the on-screen instructions to install Java on your system.

Step 2: Find the Java Installation Directory

Find the Java Installation Directory
  1. Open File Explorer: Navigate to the directory where Java is installed. By default, it is usually located in C:\Program Files\Java\jdk-version.
  2. Note the Path: Copy the full path to the JDK directory.

Step 3: Set the JAVA_HOME Environment Variable

Set the JAVA_HOME Environment Variable
  1. Open System Properties: Press Win + S, type “System”, and select “System” from the search results.
  2. Advanced System Settings: Click on “Advanced system settings” on the left side.
  3. Environment Variables: In the System Properties window, click on the “Environment Variables” button.
  4. New System Variable: In the Environment Variables window, click on “New” under the “System variables” section.
  5. Variable Name: Enter JAVA_HOME as the variable name.
  6. Variable Value: Paste the path to the JDK directory that you noted earlier.
  7. Save Changes: Click “OK” to save the new variable.

Step 4: Update the PATH Environment Variable

Update the PATH Environment Variable
  1. Edit PATH Variable: In the Environment Variables window, find the PATH variable under “System variables” and select it.
  2. Edit Variable: Click on “Edit”.
  3. Add Java Path: Click on “New” and add %JAVA_HOME%\bin to the list of paths.
  4. Save Changes: Click “OK” to save the changes.

Step 5: Verify the Setup

Verify the Setup test JAVA in Windows
  1. Open Command Prompt: Press Win + R, type cmd, and press Enter to open the Command Prompt.
  2. Check Java Version: Type java -version and press Enter. You should see the installed Java version information.
  3. Check Java Compiler: Type javac -version and press Enter. You should see the Java compiler version information.

Conclusion

By following these steps, you have successfully set the Java path in Windows 11. This will allow you to run Java applications and development tools without any issues.

LEAVE A REPLY

Please enter your comment!
Please enter your name here