Set the
environment variables for Java in Windows
Most of the
people facing problem in setting java classpath while starting java programming.
Please follow the steps to set required environment variables for java.
1
- Download
and install JDK 8 from Oracle ( http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
)
- Go to "My Computer" properties by Right Click
- Click on "Advanced system settings"
- Click on "Environment variables"
- Click on new tab of System variable
OR
Just search env
in the search bar, It will open System properties window for you.
You need to define below System variables
and its path.
- JAVA_HOME : C:\Program Files\Java\jdk1.8.0_152
- JDK_HOME : %JAVA_HOME%
- JRE_HOME : %JAVA_HOME%\jre
- CLASSPATH : .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
- PATH : your-unique-entries;%JAVA_HOME%\bin
To Verify:
i.
Open
command prompt by typing cmd in the search bar.
ii.
Type
command (java –version )
Expected output:
If you were planning to
upgrade/downgrade JDK, then you need to change only
Variable (JAVA_HOME) as all
other environment variables are derived from the "root" environment
variable JAVA_HOME.



0 comments:
Post a Comment