Sunday 25 June 2017

Why and how to set JAVA_HOME

Why to set JAVA_HOME?
Many applications like maven, elastic search etc., use JAVA_HOME property to find the location of the java they should use.

How to set JAVA_HOME?
Setting JAVA_HOME in windows

Right click on my computer -> properties.

Go to Advanced tab and click on ‘Environment Variables’ button.

In the System variables section, click on ‘New’ button.

Give the variable name as ‘JAVA_HOME’ and value to the location (For ex: C:\Program Files (x86)\Java\jdk1.8.0_102), where java is installed in your machine. Press Ok button.


That’s it you are done….:)

Setting JAVA_HOME in Linux Environment
Korn and bash shells:
export JAVA_HOME=jdk-install-dir

Bourne shell:
JAVA_HOME=jdk-install-dir
export JAVA_HOME

C shell:
setenv JAVA_HOME jdk-install-dir

You may like


No comments:

Post a Comment