System Properties

There are certain things that the JVM always knows about, that you might like to know about, too. These things consist of information about the user's working environment. That's why they are called system properties.

Commonly Used System Properties

Below are listed some of the more commonly referenced system properties. For example, your application might want to perform some specific behavior if the underlying platform is Windows, or you might want to open a JFileChooser dialog that allows the user to save a file, and have it present the user's home directory as its starting location.

user.dirUser's current working directory
user.homeUser's home directory
user.nameAccount name for currently logged in user
file.separatorFile separator ...

Get Java Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.