Add Javac to Path in Windows 10

Environment variables are the dynamic and run-time values that the OS and other software residing over your system can use to determine the information related to the system.
So these are two types user environment variables and system environment variables.
The User-Environment Variables
store information related to the user. As the name suggests, it stores details of a user after the user gets logged in.
The System-Environment Variables
are a step beyond user variables. It holds the information related to the system and not straight away related to a user. It stores the path variables and details that an application needs in the course of execution.
Steps to add javac
to the path variable in Windows 10 are below.
-
Search
edit system variables
in the search bar of Windows 10. -
Click on edit system variables and click open to the right side of it.
-
A popup window will get opened named System properties.
-
Select
environment variables
to the bottom of the window. -
A new popup will open to set environment variables.
-
Now go to the
System-variables
section. -
Choose the
new
button to add a new system variable. -
Give a new name as
JAVA_HOME
and give its value as the location where Java is kept, likeC:\Program Files\java\jdk1.8.0_191
. -
Simultaneously, we can browse the path using the
browse
button of the popup window. -
Search the
JAVA_HOME
variable in the System variables list. -
Go to the
Path
variable and click on the edit button. A new popup will open. -
Click the
new
button on the new window opened. -
Add
%JAVA_HOME%\bin
in the highlighted new line and click the OK button.
Other than the following steps, there is another way to open the environment variables window.
-
Right-click on
My Computer
over the desktop screen. -
Click the properties at the very bottom of it.
-
On the left pane, in the search bar, search Advanced System Settings.
Steps from 4 to 13 are similar in the above steps.
Rashmi is a professional Software Developer with hands on over varied tech stack. She has been working on Java, Springboot, Microservices, Typescript, MySQL, Graphql and more. She loves to spread knowledge via her writings. She is keen taking up new things and adopt in her career.
LinkedIn