If you don't have admin rights, use the below command to set environment variables for java using the command prompt

Copysetx JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
setx PATH "%PATH%;%JAVA_HOME%\bin";

Modify the environment variable.

Copysetx -m JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
setx -m PATH "%PATH%;%JAVA_HOME%\bin";
Answer from Sathiamoorthy on Stack Overflow
🌐
Medium
azimuahamed.medium.com › java-environment-variables-setup-windows-11-58fe71e43b5e
JAVA Environment Variables Setup Windows 11 | by Azim Uddin Ahamed | Medium
August 1, 2024 - In the Environment Variables window, under the “System variables” section, click “New.” · For the “Variable name,” enter JAVA_HOME. For the “Variable value,” enter the path to your JDK installation directory.
🌐
Oracle
docs.oracle.com › cd › F74770_01 › English › Installing › p6_eppm_install_config › 89522.htm
Setting an Environment Variable for Java
February 2, 2024 - Click Start, Control Panel, System, and then Advanced system settings. In the System Properties dialog box, on the Advanced tab, click Environment Variables. ... In the System Variables section, click New. In the Variable name field, enter JAVA_HOME.
🌐
Oracle
java.com › en › download › help › path.html
How do I set or change the PATH system variable?
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK. Reopen Command prompt window, and run your java code. From the desktop, right click the Computer icon. Choose Properties from ...
🌐
TheServerSide
theserverside.com › feature › How-to-set-JAVA_HOME-in-Windows-and-echo-the-result
How to set JAVA_HOME in Windows | TheServerSide
Open the Windows System Properties window. Choose Advanced System settings. Click on the Environment Variables button. Click on the New button under System Variables. Set JAVA_HOME as the environment variable name.
🌐
GeeksforGeeks
geeksforgeeks.org › java › setting-environment-java
Setting up Environment Variables For Java - Complete Guide to Set JAVA_HOME - GeeksforGeeks
May 9, 2025 - To set Java Environment Variables, you need to set, JAVA_HOME: It points to the directory where the JDK is installed on the system. PATH: It specifies where the operating system should look for executable files. Download and install the latest JDK from the official Oracle website. To know how to download JDK on Windows OS, refer to this article: How to Install Java on Windows, Linux, and macOS?
🌐
XDA Developers
xda-developers.com › home › windows11 › how to set the java path in windows 11
How to set the Java path in Windows 11
November 29, 2023 - Go back to the Environment Variables window we mentioned in step 3, and look for PATH under System variables. Click on it and then click Edit. Next, click New, and now add your bin path — in this example, it would be “C:\Program Files\Java\jdk-21\bin” · Hit OK, hit OK again, and you’re done! You are now ready to build Java apps on your Windows 11 computer.
Find elsewhere
🌐
IBM
ibm.com › docs › en › b2b-integrator › 6.2.0
Setting Java variables on Windows
JAVA_HOME and PATH variables are required for the operating system to find the required Java programs and utilities.
🌐
Exactsoftware
exactsoftware.com › docs › DocView.aspx
How-to: Setting JAVA_HOME environment variable
You have to set the JAVA_HOME environment variable prior to installing ElasticSearch. Otherwise, the message “JAVA_HOME environment variable must be set!” will be displayed during the installation. This document explains the steps to be taken to set the JAVA_HOME environment variable · ...
🌐
Oracle
docs.oracle.com › cd › E19062-01 › sun.mgmt.ctr36 › 819-5418 › 6n7gk6imj › index.html
Java Environment Variables and Path (Sun Management Center 3.6.1 Installation and Configuration Guide)
Place /usr/j2se/bin in your PATH before /usr/bin. Place /usr/bin in your PATH before /usr/ucb. Choose Start -> Settings -> Control Panel. Double-click System. On Microsoft Windows NT, select the Environment tab. On Microsoft Windows 2000, select the Advanced tab and then Environment Variables.
🌐
Javatutorial
javatutorial.net › set-java-home-windows-10
How to set JAVA_HOME in Windows 10 | Java Tutorial Network
First, download and install the JDK. Remove the JRE from the PATH Add the JAVA_HOME variable in. Then you can start using the JDK! Here’s supplementary article I put together just on JAVA_HOME: https://www.theserverside.com/feature/How-to-set-JAVA_HOME-in-Windows-and-echo-the-result
🌐
YouTube
youtube.com › watch
How to Set up Environment Variables for Java in Windows 11 - YouTube
In this video, we are going to learn how to set up environment variables for Java in Windows 11. If you want to develop Java programs on the Windows operatin...
Published   September 29, 2024
🌐
Scriptivity
scriptivity.hashnode.dev › how-to-install-java-jdk-on-windows-11-and-set-environment-variables
How to Install Java JDK on Windows 11 and Set Environment Variables
February 11, 2023 - as you guys know I need to install JDK on my windows 11 · so I'll just choose the Windows option with x64 Installer · after completing the download, you can run the installation setup · click on next · this is where java will be installed in following directory · if you want to change directory, you can choose change... but i will keep with the default · then click on next · And we successfully install JDK 19 · but it's not done yet, we still need to configure the environment variables guys ·
🌐
Precisely
help.precisely.com › r › Spectrum › spectrum_platform › 23.1 › en-US › Spectrum-Installation-Guide-for-Windows › Before-You-Begin › Install-the-JDK-and-Set-the-JAVA_HOME-Environment-Variable › Set-the-JAVA_HOME-Environment-Variable-on-Windows
Set the JAVA_HOME Environment Variable on Windows • Spectrum Installation Guide for Windows • Welcome to the Precisely Help Center
December 10, 2024 - These technologies may collect information from you, including your personal information, such as your IP address or device identifier. We use these technologies to make the site work as you expect it to, to provide a more personalized web experience, to analyze activity on our site, and in some cases, for cross-context behavioral advertising. You can manage your cookie settings below.
🌐
YouTube
youtube.com › thecoderworld
How to Set Up the JAVA_HOME Variable on Windows 11 - YouTube
In this video, we are going to learn how to set up the JAVA_HOME variable on Windows 11. Here’s a fix related to JAVA_HOME in your Java projects.Learn More: ...
Published   September 29, 2024
Views   45
🌐
IBM
ibm.com › docs › en › addi › 6.1.3
Java Requirements - IBM Documentation
April 1, 2025 - ... To ensure that the path for Java instance is set at the beginning of the PATH system environment variable in your system, follow these steps: Go to Start > System > Advanced Settings > Environment Variables > System variables.
🌐
Medium
medium.com › @adarshshaju › java-environment-variable-configuration-in-windows-afe97c5b64f7
Java environment variable configuration in Windows | Medium
May 21, 2023 - In this blog, I will show you how to configure Java environment variables in Windows without having admin access.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_build_of_openjdk › 11 › html-single › installing_and_using_red_hat_build_of_openjdk_11_for_windows › index
Installing and using Red Hat build of OpenJDK 11 for Windows | Red Hat build of OpenJDK | 11 | Red Hat Documentation
Set the %JAVA_HOME% environment variable as follows: Open Command Prompt as an administrator. Set the value of the environment variable to your Red Hat build of OpenJDK 11 for Microsoft Windows installation path:
🌐
HCL GUVI
studytonight.com › post › step-by-step-guide-to-install-jdk-11-on-windows
HCL GUVI | Learn to code in your native language
HCL GUVI IDE is an Integrated Development Environment (IDE) for coding. Allows you to write, edit, run, test, and debug your code. Comes with a built-in debugger to fix code errors. Supports JavaScript, Python, Ruby, and 20+ programming languages.Explore IDE