HI ,
I created a environment variable using:
setenv file_name /home/test/a.txt
How to access that environment variable from
java code.
I tried
String s = System.getenv("file_name");
I am getting following error when runnig :
Exception in
thread "main" java.lang.Error: getenv no longer supported, use properties and -D instead: input
at java.lang.System.getenv(System.java:691)
at Li.main(Li.java:6)
Than I tried
String s = System.getProperty("file_name"); It is giving null as output
How to access the environment vatiable ?