Search code examples
javaoperating-systemjaas

In Java5, how do I get the full name of the user running the application?


In Java5, is there a way to get the full name of the user that is running the application using only JDK APIs? (I know about JAAS and third-party libraries, but they might not be installed on the target system).

I know about System.getProperty("user.name") but that returns the user ID not user NAME.


Solution

  • The concept of a user's "full" name is OS dependent so there is not a way to get it using standard Java APIs.