Boolean.getBoolean("myvariable"); // where myvariable has been defined in the
// Environment variable as Variable name:
// myvariable
// and Variable Value:true
The above call gives me output as false.
If I use
System.getenv("myvariable") ;
then it gives me output as true.
I am wondering why Boolean.getBoolean("myvariable") is not working.
System.getenvreturns an environment variable. That’s not the same thing asSystem.getPropertywhich returns a Java system property.Boolean.getBooleanuses the latter call, as documented: