Many people, including me, get confused about Program Arguments or CommandLine
arguments, System property or VM arguments & Environment variables.
One can check for more details over the internet & how you can use these in your OS.
Here I am quickly telling when OS is windows & IDE is Eclipse.
arguments, System property or VM arguments & Environment variables.
One can check for more details over the internet & how you can use these in your OS.
Here I am quickly telling when OS is windows & IDE is Eclipse.
Now, above image is fine for 2 kind of variables, but what about Environment variables, whats
that?
Environment variables are those variables provided by the underlying OS, and if in your code
you are interested in the value of any such variable,
then you need to access it or if you want to share some property with other program running
on same OS & environment then we can create such variable
as part of environment variable of that OS
Below is for Windows, you will get this window when you search for 'environment variables', no
need to type the whole, you will get this option with
partial type itself.
that?
Environment variables are those variables provided by the underlying OS, and if in your code
you are interested in the value of any such variable,
then you need to access it or if you want to share some property with other program running
on same OS & environment then we can create such variable
as part of environment variable of that OS
Below is for Windows, you will get this window when you search for 'environment variables', no
need to type the whole, you will get this option with
partial type itself.
So click on the 'Environment Variables...' & there you can add your variable as part of System
variable, it will be available to every user on that system, else you can give it as part of User
variables. The one can access the value of that variable like shown in code below-
Here I am using existing variable 'JAVA_HOME'
variable, it will be available to every user on that system, else you can give it as part of User
variables. The one can access the value of that variable like shown in code below-
Here I am using existing variable 'JAVA_HOME'
HelloVariables
Output of above code will be like-