Load Property Configuration File

Load Property Configuration File

Sometimes while working on java application you want to load property from configuration file. In this sample java program you will see how to load and read property from configuration file:

  • Sample project where we will read property value form src\main\resources\config.properties file, sets to system property and print its value to the console:

Load Property Configuration File

  • config.properties file:

2015-05-18_2329

  • LoadPropertyFileJava.java:

  • Output:

Load Property Configuration File

  • For more details please refer Oracle documentation here

Leave a Reply

Your email address will not be published. Required fields are marked *