getUserName
public static String getUserName()
Returns the user name of the user that is running the program. The user
name is determined by using platform-specific classes from the JAAS API.
If this fails (e.g. because the platform is not supported or the JRE does
not provide those classes), the "user.name" system property is used. If
this system property is not set, the "USERNAME" environment variable is
used. If the environment variable is not set either, null
is
returned.
- Returns:
- user name of the user that is running the program or
null
if the user name cannot be determined.