My java application needs to resolve environment variables in file paths at runtime , file paths will be specified in properties file as below in case of windows it will be %JAVA_HOME%\certs\myselffign.cer in case of unix it will be $JAVA_HOME\certs\myselffign.cer
My java apps needs to resolve those file path to absolute paths and load the certificates into truststore.
Is there any way to this. As of now i am checking os.name , and if os.name is windows then pattern matching for %% and using system.getenv , in case of non windows looking for $.
I am hoping there is a better way to do this
System.getEnv()is how you do it. What's your question?