2

Iam having doubt on this, Is it mandatory to give only JAVA_HOME as variable name while setting environment variable for java?. I saw so many articles and videos everywhere same variable name JAVA_HOME. (Even for android also only ANDROID_HOME). What is the problem if we give some other variable name? can any one help on this?

Thanks in advance.

  • 1
    Well some other variable name might not cause any problems, but it wouldn't do the job of setting the Java home directory! Assuming you mean `JAVA_HOME=/some/dir java ...`, that's not an argument to `java`, that's setting an environment variable. – jonrsharpe Oct 11 '17 at 14:36
  • Look here: https://stackoverflow.com/questions/5102022/what-is-the-reason-for-the-existence-of-the-java-home-environment-variable – Simon Martinelli Oct 11 '17 at 14:41
  • Thanks for your answer @jonrsharpe – Vishwaprasad H G Oct 11 '17 at 14:43

2 Answers2

3

You can set some other name but some application that use java try to search for "JAVA_HOME" in order to setup and make itself running , say some IDE that uses java, by default it searches for that environmental variable.

Rishabh Dugar
  • 606
  • 5
  • 16
1

JAVA_HOME is the standard environment variable name for where Java resides on your system. If you change it to be JAVA_HOME_OTHER for example, any Java application relying on JAVA_HOME env variable to bet set will fail to run.

SergeyB
  • 9,478
  • 4
  • 33
  • 47