I have a java app that looks something like this
java -Dconfig.dir = ../../.. -jar blah..
how can I access this config.dir in java application at run time.I am trying to load a properties file that will be there at run time.So I want to load this in file stream
System.getProperty("config.dir")config.dirproperty is not passed as a parameter to the main method-Dconfig.dir = ../../..use it as-Dconfig.dir=../../..and then use @Ivan comment BTW: @Glains you are not right.