Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the main need of Environment variable?

Tags:

installation

Hi what is the main need for setting an Environment Variable, while we have been installing many languages. What's there need? And does the installation cant set(in case of java)? Why so?

like image 779
Ant's Avatar asked Mar 12 '11 17:03

Ant's


1 Answers

Environment variables are set to allow access to command line tools and to enable other tools to interact with SDKs more easily. For example, with Java on Windows, if the environment variable is not set on the PATH, running javac is much more cumbersome because you need to type in the full path to the command each time:

C:> \jdk<version>\bin\javac MyClass.java

In Java setting the environment variables isn't required; it's just easier. Other languages may be more stringent, though I haven't seen any specific examples I could cite. You can read the article How Do I Set the Path System variable? for specifics on how to do this.

The Java installer doesn't change the path variable, but other tools do (Microsoft's own, for example). I assume it's a design decision on the part of Sun/Oracle rather than any particular technical limitation.

like image 200
Feanor Avatar answered Oct 28 '22 10:10

Feanor