Environment variables for Java installation


Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies.

No matter how experienced you are, everyone will be freaked out while setting up Java Environment variables after migrating to new OS or trying out "Awesome" Java language for the first time by the beginners. Not all may be but atleast i get freak out for setting it up :)

But here is the quick overview or help which provides complete details of Java environment setup. After downloading and installing preferred Java version from Oracle website, head over to the My Computer, right click on it and choose Properties from the menu. The below dialog will be opened. Now click on "Advanced system settings" -> Advanced -> Environment Variables.

The below picture may slightly vary among different OS versions. But below picture shows for Windows 10 OS.





Add the below "User" variables. And you are done. 

JAVA_HOME            C:\Tools\Java\jdk_1.8.0_201
JDK_HOME              %JAVA_HOME%
JRE_HOME               %JAVA_HOME%
CLASSPATH            .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
PATH                          %JAVA_HOME%\bin


By pointing to JAVA_HOME in all other variables is very efficient and effective way to follow because it avoids common problems or errors during development phase when the installation path of Java changes or if there are multiple Java versions installed in your system where there are higher chances that you end up setting the paths wrongly. 

Hope this is helpful. Please post your comments below.

Comments

Popular posts from this blog

Bash - Execute Pl/Sql script from Shell script

Gradle Fundamentals

Load Balancing using Spring Cloud Netflix Ribbon