Java equivalent to app.config?

Omar Kooheji picture Omar Kooheji · Oct 17, 2008 · Viewed 27.1k times · Source

Is there a Java equivalent to .NET's App.Config?

If not is there a standard way to keep you application settings, so that they can be changed after an app has been distributed?

Answer

Powerlord picture Powerlord · Oct 17, 2008

For WebApps, web.xml can be used to store application settings.

Other than that, you can use the Properties class to read and write properties files.

You may also want to look at the Preferences class, which is used to read and write system and user preferences. It's an abstract class, but you can get appropriate objects using the userNodeForPackage(ClassName.class) and systemNodeForPackage(ClassName.class).