Breaking News
Home / Java / Java Snippets / How to load Properties from Classpath

How to load Properties from Classpath

Classpath loader

Loading properties is easy as long as you know the path to the properties file. This can be issue at times when you either don’t know the exact location of the file or it can change based on environment. In this case loading such file using the classpath loader turns out to handy. As long as the directory containing the file is in the classpath the loader can find it without us specifying the the exact path.

 [pb_builder]

Check Also

How to progamatically get the Java version?

Snippet The key here is to use the system property java.version and get minor and …

Advertisment ad adsense adlogger