w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to pass path from file to system property of my java class

Use Properties first to load the config file as shown below

Properties prop = new Properties();
// load a properties file
prop.load(new FileInputStream("config.properties"));

Then, to access MyfilePATH from the loaded properties use

String myPath = prop.getProperty("MyfilePATH")

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.